diff options
author | rubidium <rubidium@openttd.org> | 2009-12-02 10:44:38 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-12-02 10:44:38 +0000 |
commit | c10e95314156cfaf856a3075118b1bd2c698d139 (patch) | |
tree | 542edd8f84d6ac34d3012f25d783cefceaafcd97 /src/pathfinder/npf/npf_func.h | |
parent | c56c892b2c9a30d7a5d4e7a59053e13471f038ab (diff) | |
download | openttd-c10e95314156cfaf856a3075118b1bd2c698d139.tar.xz |
(svn r18373) -Codechange: unify some road pathfinder functions
Diffstat (limited to 'src/pathfinder/npf/npf_func.h')
-rw-r--r-- | src/pathfinder/npf/npf_func.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/pathfinder/npf/npf_func.h b/src/pathfinder/npf/npf_func.h index 027e8c794..14c4d2c53 100644 --- a/src/pathfinder/npf/npf_func.h +++ b/src/pathfinder/npf/npf_func.h @@ -17,6 +17,26 @@ #include "../pathfinder_type.h" /** + * Used when user sends road vehicle to the nearest depot or if road vehicle needs servicing using NPF. + * @param v vehicle that needs to go to some depot + * @param max_distance max distance (number of track tiles) from the current vehicle position + * (used also as optimization - the pathfinder can stop path finding if max_distance + * was reached and no depot was seen) + * @return the data about the depot + */ +FindDepotData NPFRoadVehicleFindNearestDepot(const RoadVehicle *v, int max_distance); + +/** + * Finds the best path for given road vehicle using NPF. + * @param v the RV that needs to find a path + * @param tile the tile to find the path from (should be next tile the RV is about to enter) + * @param enterdir diagonal direction which the RV will enter this new tile from + * @param trackdirs available trackdirs on the new tile (to choose from) + * @return the best trackdir for next turn or INVALID_TRACKDIR if the path could not be found + */ +Trackdir NPFRoadVehicleChooseTrack(const RoadVehicle *v, TileIndex tile, DiagDirection enterdir, TrackdirBits trackdirs); + +/** * Finds the best path for given ship using NPF. * @param v the ship that needs to find a path * @param tile the tile to find the path from (should be next tile the ship is about to enter) |