X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fvehicletype.h;h=31b6992a134773c474cf1ab2868b054ccbcaca83;hb=bc9e941447da48905295192289bc09483a678180;hp=841664e375f10f61b079b52a535318c79cd4ea76;hpb=2910db1364914c0ab98a0f80250cc39137821577;p=r2c2.git diff --git a/source/libr2c2/vehicletype.h b/source/libr2c2/vehicletype.h index 841664e..31b6992 100644 --- a/source/libr2c2/vehicletype.h +++ b/source/libr2c2/vehicletype.h @@ -18,6 +18,7 @@ public: public: Loader(VehicleType &); private: + virtual void finish(); void axle(); void bogie(); void function(unsigned, const std::string &); @@ -27,6 +28,8 @@ public: void width(float); }; + struct Bogie; + struct Axle { class Loader: public Msp::DataFile::ObjectLoader @@ -38,6 +41,9 @@ public: void wheel_diameter(float); }; + unsigned index; + Bogie *bogie; + float local_position; float position; float wheel_dia; bool powered; @@ -46,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 @@ -120,8 +127,9 @@ public: Rod(); }; + typedef std::vector AxleArray; + typedef std::vector BogieArray; typedef std::vector RodArray; - typedef std::map FunctionMap; private: @@ -132,6 +140,7 @@ private: float width; float height; AxleArray axles; + std::vector fixed_axles; BogieArray bogies; RodArray rods; std::string object; @@ -147,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;