]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/locotype.cpp
Fix a compile error
[r2c2.git] / source / libmarklin / locotype.cpp
index 6dcd6ae302920757072eee25c0fb5d00eb168ed6..c00f7d3a94deda2c2586d4f66b080c1a71367ca0 100644 (file)
@@ -12,20 +12,26 @@ using namespace std;
 namespace Marklin {
 
 LocoType::LocoType(unsigned an):
-       art_nr(an)
+       VehicleType(an)
 { }
 
+unsigned LocoType::get_max_function() const
+{
+       if(funcs.empty())
+               return 0;
+       return (--funcs.end())->first;
+}
+
 
 LocoType::Loader::Loader(LocoType &lt):
-       Msp::DataFile::BasicLoader<LocoType>(lt)
+       VehicleType::Loader(lt)
 {
        add("function", &Loader::function);
-       add("name",     &LocoType::name);
 }
 
 void LocoType::Loader::function(unsigned i, const string &f)
 {
-       obj.funcs[i] = f;
+       static_cast<LocoType &>(obj).funcs[i] = f;
 }
 
 } // namespace Marklin