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