OpenTTD
npf_func.h
Go to the documentation of this file.
1 /* $Id$ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * 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.
6  * 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.
7  * 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/>.
8  */
9 
12 #ifndef NPF_FUNC_H
13 #define NPF_FUNC_H
14 
15 #include "../../track_type.h"
16 #include "../../direction_type.h"
17 #include "../../vehicle_type.h"
18 #include "../pathfinder_type.h"
19 
29 
38 Trackdir NPFRoadVehicleChooseTrack(const RoadVehicle *v, TileIndex tile, DiagDirection enterdir, bool &path_found);
39 
46 Track NPFShipChooseTrack(const Ship *v, bool &path_found);
47 
53 bool NPFShipCheckReverse(const Ship *v);
54 
63 FindDepotData NPFTrainFindNearestDepot(const Train *v, int max_penalty);
64 
74 bool NPFTrainFindNearestSafeTile(const Train *v, TileIndex tile, Trackdir td, bool override_railtype);
75 
81 bool NPFTrainCheckReverse(const Train *v);
82 
91 Track NPFTrainChooseTrack(const Train *v, bool &path_found, bool reserve_track, struct PBSTileInfo *target);
92 
93 #endif /* NPF_FUNC_H */
Track NPFShipChooseTrack(const Ship *v, bool &path_found)
Finds the best path for given ship using NPF.
Definition: npf.cpp:1199
Trackdir
Enumeration for tracks and directions.
Definition: track_type.h:72
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:1240
Buses, trucks and trams belong to this class.
Definition: roadveh.h:109
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:1302
All ships have this type.
Definition: ship.h:28
&#39;Train&#39; is either a loco or a wagon.
Definition: train.h:87
This struct contains information about the end of a reserved path.
Definition: pbs.h:28
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:1262
uint32 TileIndex
The index/ID of a Tile.
Definition: tile_type.h:80
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:1283
Track
These are used to specify a single track.
Definition: track_type.h:21
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:1220
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:1160
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:1177