Add: Road vehicle path cache. (#7261)

This commit is contained in:
PeterN
2019-03-08 23:52:45 +00:00
committed by GitHub
parent dae35188ab
commit 6c6971fb43
9 changed files with 107 additions and 23 deletions

View File

@@ -16,6 +16,7 @@
#include "../../track_type.h"
#include "../../vehicle_type.h"
#include "../../ship.h"
#include "../../roadveh.h"
#include "../pathfinder_type.h"
/**
@@ -45,7 +46,7 @@ bool YapfShipCheckReverse(const Ship *v);
* @param path_found [out] Whether a path has been found (true) or has been guessed (false)
* @return the best trackdir for next turn or INVALID_TRACKDIR if the path could not be found
*/
Trackdir YapfRoadVehicleChooseTrack(const RoadVehicle *v, TileIndex tile, DiagDirection enterdir, TrackdirBits trackdirs, bool &path_found);
Trackdir YapfRoadVehicleChooseTrack(const RoadVehicle *v, TileIndex tile, DiagDirection enterdir, TrackdirBits trackdirs, bool &path_found, RoadVehPathCache &path_cache);
/**
* Finds the best path for given train using YAPF.