OpenTTD Source  12.0-beta2
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 */
RoadVehicle
Buses, trucks and trams belong to this class.
Definition: roadveh.h:107
TileIndex
uint32 TileIndex
The index/ID of a Tile.
Definition: tile_type.h:83
NPFTrainCheckReverse
bool NPFTrainCheckReverse(const Train *v)
Returns true if it is better to reverse the train before leaving station using NPF.
Definition: npf.cpp:1277
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:1296
FindDepotData
Helper container to find a depot.
Definition: pathfinder_type.h:53
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:1154
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:1171
NPFShipChooseTrack
Track NPFShipChooseTrack(const Ship *v, bool &path_found)
Finds the best path for given ship using NPF.
Definition: npf.cpp:1193
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:86
DiagDirection
DiagDirection
Enumeration for diagonal directions.
Definition: direction_type.h:77
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:1256
NPFShipCheckReverse
bool NPFShipCheckReverse(const Ship *v)
Returns true if it is better to reverse the ship before leaving depot using NPF.
Definition: npf.cpp:1214
Ship
All ships have this type.
Definition: ship.h:26
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:1234
Trackdir
Trackdir
Enumeration for tracks and directions.
Definition: track_type.h:70
Track
Track
These are used to specify a single track.
Definition: track_type.h:19