X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fvehicletype.h;h=31b6992a134773c474cf1ab2868b054ccbcaca83;hb=2314cc760b726c5aa0e697c82f3a9051784e0706;hp=145a08dec64c992ab4da7e261675711c5af3af1c;hpb=350bed224de78737a073df9a2df7427b7036ac33;p=r2c2.git diff --git a/source/libr2c2/vehicletype.h b/source/libr2c2/vehicletype.h index 145a08d..31b6992 100644 --- a/source/libr2c2/vehicletype.h +++ b/source/libr2c2/vehicletype.h @@ -28,6 +28,8 @@ public: void width(float); }; + struct Bogie; + struct Axle { class Loader: public Msp::DataFile::ObjectLoader @@ -39,6 +41,9 @@ public: void wheel_diameter(float); }; + unsigned index; + Bogie *bogie; + float local_position; float position; float wheel_dia; bool powered; @@ -47,29 +52,30 @@ public: Axle(); }; - typedef std::vector AxleArray; - struct Bogie { class Loader: public Msp::DataFile::ObjectLoader { + private: + VehicleType &parent; + public: - Loader(Bogie &); + Loader(VehicleType &, Bogie &); private: void axle(); void position(float); }; + unsigned index; float position; - AxleArray axles; + unsigned first_axle; + std::vector axles; std::string object; bool rotate_object; Bogie(); }; - typedef std::vector BogieArray; - struct Rod { enum Anchor @@ -121,8 +127,9 @@ public: Rod(); }; + typedef std::vector AxleArray; + typedef std::vector BogieArray; typedef std::vector RodArray; - typedef std::map FunctionMap; private: @@ -133,6 +140,7 @@ private: float width; float height; AxleArray axles; + std::vector fixed_axles; BogieArray bogies; RodArray rods; std::string object; @@ -148,7 +156,8 @@ public: float get_length() const { return length; } float get_width() const { return width; } float get_height() const { return height; } - const AxleArray &get_fixed_axles() const { return axles; } + const AxleArray &get_axles() const { return axles; } + const Axle &get_axle(unsigned) const; const Axle &get_fixed_axle(unsigned) const; const BogieArray &get_bogies() const { return bogies; } const Bogie &get_bogie(unsigned) const;