#include "vehicletype.h"
+using namespace std;
using namespace Msp;
namespace Marklin {
height(0)
{ }
+unsigned VehicleType::get_max_function() const
+{
+ if(functions.empty())
+ return 0;
+ return (--functions.end())->first;
+}
+
VehicleType::Axle::Axle():
position(0),
VehicleType::Loader::Loader(VehicleType &vt):
DataFile::ObjectLoader<VehicleType>(vt)
{
- add("axle", &Loader::axle);
- add("bogie", &Loader::bogie);
- add("height", &Loader::height);
- add("length", &Loader::length);
- add("object", &VehicleType::object);
- add("name", &VehicleType::name);
- add("width", &Loader::width);
+ add("axle", &Loader::axle);
+ add("bogie", &Loader::bogie);
+ add("function", &Loader::function);
+ add("height", &Loader::height);
+ add("length", &Loader::length);
+ add("locomotive", &VehicleType::locomotive);
+ add("object", &VehicleType::object);
+ add("name", &VehicleType::name);
+ add("width", &Loader::width);
}
void VehicleType::Loader::axle()
obj.bogies.push_back(bog);
}
+void VehicleType::Loader::function(unsigned i, const string &f)
+{
+ obj.functions[i] = f;
+}
+
void VehicleType::Loader::height(float h)
{
obj.height = h/1000;