OpenTTD Source: src/pathfinder/npf/npf_func.h Source File

OpenTTD Source 14.0-beta3

npf_func.h
Go to the documentation of this file.
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
7
10 #ifndef NPF_FUNC_H
11 #define NPF_FUNC_H
12
13 #include "../../track_type.h"
14 #include "../../direction_type.h"
15 #include "../../vehicle_type.h"
16 #include "../pathfinder_type.h"
17
26 FindDepotData NPFRoadVehicleFindNearestDepot(const RoadVehicle *v, int max_penalty);
27
36 Trackdir NPFRoadVehicleChooseTrack(const RoadVehicle *v, TileIndex tile, DiagDirection enterdir, bool &path_found);
37
44 Track NPFShipChooseTrack(const Ship *v, bool &path_found);
45
52 bool NPFShipCheckReverse(const Ship *v, Trackdir *trackdir);
53
62 FindDepotData NPFTrainFindNearestDepot(const Train *v, int max_penalty);
63
73 bool NPFTrainFindNearestSafeTile(const Train *v, TileIndex tile, Trackdir td, bool override_railtype);
74
80 bool NPFTrainCheckReverse(const Train *v);
81
90 Track NPFTrainChooseTrack(const Train *v, bool &path_found, bool reserve_track, struct PBSTileInfo *target);
91
92 #endif /* NPF_FUNC_H */
RoadVehicle
Buses, trucks and trams belong to this class.
Definition: roadveh.h:106
NPFTrainCheckReverse
bool NPFTrainCheckReverse(const Train *v)
Returns true if it is better to reverse the train before leaving station using NPF.
Definition: npf.cpp:1292
NPFTrainChooseTrack
Track NPFTrainChooseTrack(const Train *v, bool &path_found, bool reserve_track, struct PBSTileInfo *target)
Finds the best path for given train using NPF.
Definition: npf.cpp:1311
FindDepotData
Helper container to find a depot.
Definition: pathfinder_type.h:51
NPFRoadVehicleFindNearestDepot
FindDepotData NPFRoadVehicleFindNearestDepot(const RoadVehicle *v, int max_penalty)
Used when user sends road vehicle to the nearest depot or if road vehicle needs servicing using NPF.
Definition: npf.cpp:1152
StrongType::Typedef< uint32_t, struct TileIndexTag, StrongType::Compare, StrongType::Integer, StrongType::Compatible< int32_t >, StrongType::Compatible< int64_t > >
NPFRoadVehicleChooseTrack
Trackdir NPFRoadVehicleChooseTrack(const RoadVehicle *v, TileIndex tile, DiagDirection enterdir, bool &path_found)
Finds the best path for given road vehicle using NPF.
Definition: npf.cpp:1169
NPFShipChooseTrack
Track NPFShipChooseTrack(const Ship *v, bool &path_found)
Finds the best path for given ship using NPF.
Definition: npf.cpp:1191
PBSTileInfo
This struct contains information about the end of a reserved path.
Definition: pbs.h:26
Train
'Train' is either a loco or a wagon.
Definition: train.h:89
DiagDirection
DiagDirection
Enumeration for diagonal directions.
Definition: direction_type.h:73
NPFTrainFindNearestSafeTile
bool NPFTrainFindNearestSafeTile(const Train *v, TileIndex tile, Trackdir td, bool override_railtype)
Try to extend the reserved path of a train to the nearest safe tile using NPF.
Definition: npf.cpp:1271
Ship
All ships have this type.
Definition: ship.h:24
NPFShipCheckReverse
bool NPFShipCheckReverse(const Ship *v, Trackdir *trackdir)
Returns true if it is better to reverse the ship before leaving depot using NPF.
Definition: npf.cpp:1212
NPFTrainFindNearestDepot
FindDepotData NPFTrainFindNearestDepot(const Train *v, int max_penalty)
Used when user sends train to the nearest depot or if train needs servicing using NPF.
Definition: npf.cpp:1249
Trackdir
Trackdir
Enumeration for tracks and directions.
Definition: track_type.h:67
Track
Track
These are used to specify a single track.
Definition: track_type.h:19