OpenTTD
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 
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 
51 bool NPFShipCheckReverse(const Ship *v);
52 
61 FindDepotData NPFTrainFindNearestDepot(const Train *v, int max_penalty);
62 
72 bool NPFTrainFindNearestSafeTile(const Train *v, TileIndex tile, Trackdir td, bool override_railtype);
73 
79 bool NPFTrainCheckReverse(const Train *v);
80 
89 Track NPFTrainChooseTrack(const Train *v, bool &path_found, bool reserve_track, struct PBSTileInfo *target);
90 
91 #endif /* NPF_FUNC_H */
Track NPFShipChooseTrack(const Ship *v, bool &path_found)
Finds the best path for given ship using NPF.
Definition: npf.cpp:1197
Trackdir
Enumeration for tracks and directions.
Definition: track_type.h:70
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:1238
Buses, trucks and trams belong to this class.
Definition: roadveh.h:107
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:1300
All ships have this type.
Definition: ship.h:26
&#39;Train&#39; is either a loco or a wagon.
Definition: train.h:85
This struct contains information about the end of a reserved path.
Definition: pbs.h:26
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:1260
uint32 TileIndex
The index/ID of a Tile.
Definition: tile_type.h:78
Helper container to find a depot.
bool NPFTrainCheckReverse(const Train *v)
Returns true if it is better to reverse the train before leaving station using NPF.
Definition: npf.cpp:1281
Track
These are used to specify a single track.
Definition: track_type.h:19
DiagDirection
Enumeration for diagonal directions.
bool NPFShipCheckReverse(const Ship *v)
Returns true if it is better to reverse the ship before leaving depot using NPF.
Definition: npf.cpp:1218
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:1158
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:1175