From: Mikko Rasa Date: Sat, 3 May 2014 10:59:57 +0000 (+0300) Subject: Also store gauge in VehicleType X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=7ecefa673473c6d6ef9505ca415d5b0e4dbc3944;p=r2c2.git Also store gauge in VehicleType --- diff --git a/locos.dat b/locos.dat index fb22469..3547d51 100644 --- a/locos.dat +++ b/locos.dat @@ -9,6 +9,7 @@ vehicle \39230 function 2 "sfx"; function 3 "whst"; + gauge 16.5; length 154; width 38; height 53; @@ -41,6 +42,7 @@ vehicle \29820-02 function 5 "whst"; maximum_speed 0.255; + gauge 16.5; length 160; width 37; height 50.5; @@ -288,6 +290,7 @@ vehicle \29530-01 function 2 "telex"; maximum_speed 0.255; + gauge 16.5; length 144; width 33; height 33; @@ -317,6 +320,7 @@ vehicle \36850 function 0 "light"; maximum_speed 0.447; + gauge 16.5; length 218; width 34; height 43; @@ -346,6 +350,7 @@ vehicle \37225-02 function 0 "light"; maximum_speed 0.287; + gauge 16.5; length 212; width 34; height 45; @@ -381,6 +386,7 @@ vehicle \39410 function 5 "whstl"; maximum_speed 0.383; + gauge 16.5; length 180; width 35; height 44; @@ -414,6 +420,7 @@ vehicle \37574-01 swap_direction true; maximum_speed 0.639; + gauge 16.5; length 219; width 35; height 49; @@ -449,6 +456,7 @@ vehicle \37504 function 3 "whstl"; maximum_speed 0.383; + gauge 16.5; length 268; width 33; height 44; @@ -481,6 +489,7 @@ vehicle \37851 function 3 "whstl"; maximum_speed 0.319; + gauge 16.5; length 224; width 35; height 47; @@ -512,6 +521,7 @@ vehicle \37968 function 3 "whstl"; maximum_speed 0.160; + gauge 16.5; length 203; width 35; height 49; diff --git a/source/libr2c2/vehicletype.cpp b/source/libr2c2/vehicletype.cpp index 15733c3..58ef1d4 100644 --- a/source/libr2c2/vehicletype.cpp +++ b/source/libr2c2/vehicletype.cpp @@ -14,6 +14,7 @@ VehicleType::VehicleType(const ArticleNumber &an): ObjectType(an), locomotive(false), swap_direction(false), + gauge(1.524), length(0), width(0), height(0), @@ -107,6 +108,7 @@ VehicleType::Loader::Loader(VehicleType &vt): add("axle", &Loader::axle); add("bogie", &Loader::bogie); add("function", &Loader::function); + add("gauge", &Loader::gauge); add("height", &Loader::height); add("length", &Loader::length); add("locomotive", &VehicleType::locomotive); @@ -168,6 +170,11 @@ void VehicleType::Loader::function(unsigned i, const string &f) obj.functions[i] = f; } +void VehicleType::Loader::gauge(float g) +{ + obj.gauge = g/1000; +} + void VehicleType::Loader::height(float h) { obj.height = h/1000; diff --git a/source/libr2c2/vehicletype.h b/source/libr2c2/vehicletype.h index e49a48f..789aeb3 100644 --- a/source/libr2c2/vehicletype.h +++ b/source/libr2c2/vehicletype.h @@ -25,6 +25,7 @@ public: void axle(); void bogie(); void function(unsigned, const std::string &); + void gauge(float); void height(float); void length(float); void mirror_rods(); @@ -166,6 +167,7 @@ private: bool locomotive; FunctionMap functions; bool swap_direction; + float gauge; float length; float width; float height; @@ -184,6 +186,7 @@ public: unsigned get_max_function() const; const FunctionMap &get_functions() const { return functions; } bool get_swap_direction() const { return swap_direction; } + float get_gauge() const { return gauge; } float get_length() const { return length; } float get_width() const { return width; } float get_height() const { return height; } diff --git a/wagons.dat b/wagons.dat index 4bae289..4f0592c 100644 --- a/wagons.dat +++ b/wagons.dat @@ -4,6 +4,7 @@ vehicle \46274 { name "Saar Railroad Gmhs 54"; + gauge 16.5; length 116; width 33; height 47; @@ -18,6 +19,7 @@ vehicle \29820-02b { name "BR 50 tender"; + gauge 16.5; length 96; width 35; height 47; @@ -44,6 +46,7 @@ vehicle \4442 { name "Z"; + gauge 16.5; length 114; width 32; height 48; @@ -58,6 +61,7 @@ vehicle \29859b { name "Zas"; + gauge 16.5; length 180; width 34; height 47; @@ -82,6 +86,7 @@ vehicle \100004 { name "Omm 52"; + gauge 16.5; length 116; width 34; height 33; @@ -96,6 +101,7 @@ vehicle \47001 { name "Rs 684"; + gauge 16.5; length 229; width 34; height 29; @@ -122,6 +128,7 @@ vehicle \48943 { name "BTr 10"; + gauge 16.5; length 112; width 34; height 34; @@ -136,6 +143,7 @@ vehicle \43222 { name "B4üw 38 \"Schürzenwagen\""; + gauge 16.5; length 244; width 34; height 45; @@ -160,6 +168,7 @@ vehicle \39230b { name "BR 23 tender"; + gauge 16.5; length 92; width 34; height 46; @@ -184,6 +193,7 @@ vehicle \43800 { name "B4nzb 64 \"Silberling\""; + gauge 16.5; length 282; width 30; height 46; @@ -211,6 +221,7 @@ vehicle \47072 { name "Sgns 691"; + gauge 16.5; length 228; width 30; height 15; @@ -237,6 +248,7 @@ vehicle \4624 { name "Fals-u 176"; + gauge 16.5; length 134; width 36; height 45; @@ -263,6 +275,7 @@ vehicle \4423 { name "Kklm 505"; + gauge 16.5; length 115; width 33; height 21; @@ -277,6 +290,7 @@ vehicle \4410 { name "Gs 210"; + gauge 16.5; length 115; width 33; height 47; @@ -291,6 +305,7 @@ vehicle \46977 { name "Rlmmso 56"; + gauge 16.5; length 157; width 31; height 21; @@ -305,6 +320,7 @@ vehicle \4699 { name "Pwg 14"; + gauge 16.5; length 98; width 31; height 43; @@ -319,6 +335,7 @@ vehicle \46717 { name "Railway crane"; + gauge 16.5; length 83; width 32; height 16; @@ -334,6 +351,7 @@ vehicle \4690 { name "Eaos 106"; + gauge 16.5; length 160; width 35; height 38; @@ -362,6 +380,7 @@ vehicle \37504b // XXX The power car is really in the middle, but that configuration isn't supported yet name "BR 421 S-bahn"; + gauge 16.5; length 238; width 33; height 44; @@ -390,6 +409,7 @@ vehicle \37504c // XXX Better solution would be to allow flipping of vehicles name "BR 420 S-bahn"; + gauge 16.5; length 268; width 33; height 44;