X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fvehicletype.h;h=d9afdbce8c00aa60f4e32e224c782176cd239b22;hb=ce29d0ccf89840c9581314301de0ea2b5b261c43;hp=c0fe0ea5136f3c56bf7a94a6089fe2cc7db64a88;hpb=37af7970d9cefcf40ae58ca06ca8469f56b0cc13;p=r2c2.git diff --git a/source/libr2c2/vehicletype.h b/source/libr2c2/vehicletype.h index c0fe0ea..d9afdbc 100644 --- a/source/libr2c2/vehicletype.h +++ b/source/libr2c2/vehicletype.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of R²C² -Copyright © 2010 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #ifndef LIBR2C2_VEHICLETYPE_H_ #define LIBR2C2_VEHICLETYPE_H_ @@ -53,6 +46,8 @@ public: Axle(); }; + typedef std::vector AxleArray; + struct Bogie { class Loader: public Msp::DataFile::ObjectLoader @@ -65,13 +60,15 @@ public: }; float position; - std::vector axles; + AxleArray axles; std::string object; bool rotate_object; Bogie(); }; + typedef std::vector BogieArray; + struct Rod { enum Anchor @@ -112,28 +109,33 @@ public: Anchor pivot; unsigned pivot_index; unsigned pivot_index2; - Point pivot_point; + Vector pivot_point; Limit limit; int connect_index; - Point connect_point; - Point connect_offset; + Vector connect_point; + Vector connect_offset; std::string object; bool mirror_object; Rod(); }; + typedef std::vector RodArray; + + typedef std::map FunctionMap; + private: ArticleNumber art_nr; std::string name; bool locomotive; - std::map functions; + FunctionMap functions; + bool swap_direction; float length; float width; float height; - std::vector axles; - std::vector bogies; - std::vector rods; + AxleArray axles; + BogieArray bogies; + RodArray rods; std::string object; public: @@ -143,13 +145,18 @@ public: const std::string &get_name() const { return name; } bool is_locomotive() const { return locomotive; } unsigned get_max_function() const; - const std::map &get_functions() const { return functions; } + const FunctionMap &get_functions() const { return functions; } + bool get_swap_direction() const { return swap_direction; } float get_length() const { return length; } float get_width() const { return width; } float get_height() const { return height; } - const std::vector &get_axles() const { return axles; } - const std::vector &get_bogies() const { return bogies; } - const std::vector &get_rods() const { return rods; } + const AxleArray &get_fixed_axles() const { return axles; } + const Axle &get_fixed_axle(unsigned) const; + const BogieArray &get_bogies() const { return bogies; } + const Bogie &get_bogie(unsigned) const; + const Axle &get_bogie_axle(unsigned, unsigned) const; + const RodArray &get_rods() const { return rods; } + const Rod &get_rod(unsigned) const; float get_front_axle_offset() const; float get_back_axle_offset() const; const std::string &get_object() const { return object; }