X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Flocotype.cpp;h=c00f7d3a94deda2c2586d4f66b080c1a71367ca0;hb=4d33c389881ebdf0b3926343d53e7d1ece654e20;hp=9eed205289a74c61566349f9f239a179e53796c1;hpb=3df8cb5c78fbb0b919bcb79677c6c788b8028482;p=r2c2.git diff --git a/source/libmarklin/locotype.cpp b/source/libmarklin/locotype.cpp index 9eed205..c00f7d3 100644 --- a/source/libmarklin/locotype.cpp +++ b/source/libmarklin/locotype.cpp @@ -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 <): - Msp::DataFile::BasicLoader(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(obj).funcs[i] = f; } } // namespace Marklin