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:1155
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:1196
Track
These are used to specify a single track.
Definition: track_type.h:21
Buses, trucks and trams belong to this class.
Definition: roadveh.h:88
Trackdir
Enumeration for tracks and directions.
Definition: track_type.h:74
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:1258
DiagDirection
Enumeration for diagonal directions.
All ships have this type.
Definition: ship.h:28
&#39;Train&#39; is either a loco or a wagon.
Definition: train.h:88
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:1218
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:1239
bool NPFShipCheckReverse(const Ship *v)
Returns true if it is better to reverse the ship before leaving depot using NPF.
Definition: npf.cpp:1176
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:1116
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:1133