]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/vehicletype.cpp
Add a vehicle property for swapping directions
[r2c2.git] / source / libr2c2 / vehicletype.cpp
index 7b355ac105230458f5a5856abfb7677d687cc1de..6c9d387ad7978f1da7ae4d65701050633eabe719 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of R²C²
-Copyright © 2010  Mikkosoft Productions, Mikko Rasa
+Copyright © 2010-2011  Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
@@ -15,6 +15,7 @@ namespace R2C2 {
 VehicleType::VehicleType(const ArticleNumber &an):
        art_nr(an),
        locomotive(false),
+       swap_direction(false),
        length(0),
        width(0),
        height(0)
@@ -27,7 +28,7 @@ unsigned VehicleType::get_max_function() const
        return (--functions.end())->first;
 }
 
-const VehicleType::Axle &VehicleType::get_axle(unsigned i) const
+const VehicleType::Axle &VehicleType::get_fixed_axle(unsigned i) const
 {
        if(i>=axles.size())
                throw InvalidParameterValue("Axle index out of range");
@@ -119,6 +120,7 @@ VehicleType::Loader::Loader(VehicleType &vt):
        add("name",       &VehicleType::name);
        add("object",     &VehicleType::object);
        add("rod",        &Loader::rod);
+       add("swap_direction", &VehicleType::swap_direction);
        add("width",      &Loader::width);
 }