From 81330b8d6edee68c38717462737fbfca6420701d Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Mon, 14 Jan 2019 23:33:42 +0000 Subject: Change: Add path cache for ships. --- src/ship.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ship.h') diff --git a/src/ship.h b/src/ship.h index 7fea5fc1d..6e73332a5 100644 --- a/src/ship.h +++ b/src/ship.h @@ -12,17 +12,22 @@ #ifndef SHIP_H #define SHIP_H +#include + #include "vehicle_base.h" #include "water_map.h" void GetShipSpriteSize(EngineID engine, uint &width, uint &height, int &xoffs, int &yoffs, EngineImageType image_type); WaterClass GetEffectiveWaterClass(TileIndex tile); +typedef std::deque ShipPathCache; + /** * All ships have this type. */ struct Ship FINAL : public SpecializedVehicle { TrackBitsByte state; ///< The "track" the ship is following. + ShipPathCache path; ///< Cached path. /** We don't want GCC to zero our struct! It already is zeroed and has an index! */ Ship() : SpecializedVehicleBase() {} @@ -46,6 +51,7 @@ struct Ship FINAL : public SpecializedVehicle { TileIndex GetOrderStationLocation(StationID station); bool FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse); void UpdateCache(); + void SetDestTile(TileIndex tile); }; static const uint SHIP_MAX_ORDER_DISTANCE = 130; -- cgit v1.2.3-70-g09d2