summaryrefslogtreecommitdiff
path: root/game/vehicles/vehicle.h
diff options
context:
space:
mode:
Diffstat (limited to 'game/vehicles/vehicle.h')
-rw-r--r--game/vehicles/vehicle.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/game/vehicles/vehicle.h b/game/vehicles/vehicle.h
index d59588c..f7defb3 100644
--- a/game/vehicles/vehicle.h
+++ b/game/vehicles/vehicle.h
@@ -6,13 +6,26 @@
#include <game/worldobject.h>
#include <string>
+class LinkHistory {
+public:
+ using Entry = std::pair<LinkWPtr, unsigned char /*dir*/>;
+ using Return = std::pair<LinkCPtr, unsigned char /*dir*/>;
+ Return add(const LinkWPtr &, unsigned char);
+ Return getAt(float) const;
+
+private:
+ std::vector<Entry> links;
+ float totalLen;
+};
+
class Vehicle : public WorldObject, public Physical {
public:
Vehicle(const LinkPtr & link, const std::string & obj, const std::string & tex);
- LinkWPtr link; // Which link are we travelling along
- unsigned char linkDir {0}; // Starting end e0->e1 or e1->e0
float linkDist {0}; // distance long current link
float speed {50}; // speed in m/s (~75 km/h)
+
+protected:
+ LinkHistory linkHist;
};
#endif