diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-06 18:53:22 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-03-06 18:53:22 +0000 |
commit | acd16970bc93712e7c8c3996816242a04999818b (patch) | |
tree | 24dbc35c1fde12a3d429539bf24605b738f4bef9 /game/vehicles/vehicle.h | |
parent | Give collection a virtual desctructor (diff) | |
download | ilt-acd16970bc93712e7c8c3996816242a04999818b.tar.bz2 ilt-acd16970bc93712e7c8c3996816242a04999818b.tar.xz ilt-acd16970bc93712e7c8c3996816242a04999818b.zip |
Introduce the Train concept as a literal collection of rail vehicles
Diffstat (limited to 'game/vehicles/vehicle.h')
-rw-r--r-- | game/vehicles/vehicle.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/game/vehicles/vehicle.h b/game/vehicles/vehicle.h index a511d3c..89a6901 100644 --- a/game/vehicles/vehicle.h +++ b/game/vehicles/vehicle.h @@ -4,11 +4,12 @@ #include <game/network/link.h> #include <game/worldobject.h> #include <gfx/renderable.h> -#include <location.hpp> #include <memory> #include <utility> #include <vector> +class Location; + class LinkHistory { public: using WEntry = std::pair<LinkWPtr, unsigned char /*dir*/>; @@ -25,10 +26,10 @@ private: class Vehicle : public WorldObject, public Renderable { public: explicit Vehicle(const LinkPtr & link, float linkDist = 0); - float linkDist; // distance long current link + float linkDist; // distance along current link float speed {50}; // speed in m/s (~75 km/h) - Location location; + [[nodiscard]] virtual const Location & getLocation() const = 0; protected: LinkHistory linkHist; |