#ifndef VEHICLE_H #define VEHICLE_H #include "game/physical.h" #include #include #include #include #include #include class LinkHistory { public: using Entry = std::pair; using Return = std::pair; Return add(const LinkWPtr &, unsigned char); [[nodiscard]] Return getCurrent() const; [[nodiscard]] Return getAt(float, float *) const; private: std::vector links; float totalLen {0.F}; }; class Vehicle : public WorldObject, public Physical { public: Vehicle(const LinkPtr & link, const std::string & obj, const std::string & tex); float linkDist {0}; // distance long current link float speed {50}; // speed in m/s (~75 km/h) protected: LinkHistory linkHist; }; using VehicleWPtr = std::weak_ptr; #endif