X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fvehicletype.h;h=145a08dec64c992ab4da7e261675711c5af3af1c;hb=ab64a17394440c3cb18d0b30d75fb4ed6297a6b4;hp=33d7d6590dba03fdec299a0e4932a5f1e1528f21;hpb=2d44923e135a119fde31a7a50e5fcd3e400e4f41;p=r2c2.git diff --git a/source/libr2c2/vehicletype.h b/source/libr2c2/vehicletype.h index 33d7d65..145a08d 100644 --- a/source/libr2c2/vehicletype.h +++ b/source/libr2c2/vehicletype.h @@ -1,23 +1,16 @@ -/* $Id$ - -This file is part of R²C² -Copyright © 2010-2011 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #ifndef LIBR2C2_VEHICLETYPE_H_ #define LIBR2C2_VEHICLETYPE_H_ #include -#include "articlenumber.h" #include "geometry.h" +#include "objecttype.h" namespace R2C2 { -class VehicleType +class VehicleType: public ObjectType { public: - class Loader: public Msp::DataFile::ObjectLoader + class Loader: public Msp::DataFile::DerivedObjectLoader { private: std::map rod_tags; @@ -25,6 +18,7 @@ public: public: Loader(VehicleType &); private: + virtual void finish(); void axle(); void bogie(); void function(unsigned, const std::string &); @@ -129,11 +123,11 @@ public: 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; @@ -142,15 +136,14 @@ private: BogieArray bogies; RodArray rods; std::string object; + bool rotate_object; public: VehicleType(const ArticleNumber &); - const ArticleNumber &get_article_number() const { return art_nr; } - 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; } @@ -165,6 +158,7 @@ public: float get_front_axle_offset() const; float get_back_axle_offset() const; const std::string &get_object() const { return object; } + bool get_rotate_object() const { return rotate_object; } }; } // namespace R2C2