X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Flocotype.cpp;h=7a1becf35ac5152db6d926a1c73673ed271ea895;hb=90790c9a28793d31b9ea38eea2f55652a0e9297b;hp=bfb7bc301feb180785d5c34fca2715efa73e1c0f;hpb=3e9c210ddc036cd015228504cc0803c909e27f84;p=r2c2.git diff --git a/source/libmarklin/locotype.cpp b/source/libmarklin/locotype.cpp index bfb7bc3..7a1becf 100644 --- a/source/libmarklin/locotype.cpp +++ b/source/libmarklin/locotype.cpp @@ -1,7 +1,7 @@ /* $Id$ This file is part of the MSP Märklin suite -Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa +Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa Distributed under the GPL */ @@ -15,9 +15,16 @@ LocoType::LocoType(unsigned an): art_nr(an) { } +unsigned LocoType::get_max_function() const +{ + if(funcs.empty()) + return 0; + return (--funcs.end())->first; +} + LocoType::Loader::Loader(LocoType <): - ltype(lt) + Msp::DataFile::BasicLoader(lt) { add("function", &Loader::function); add("name", &LocoType::name); @@ -25,7 +32,7 @@ LocoType::Loader::Loader(LocoType <): void LocoType::Loader::function(unsigned i, const string &f) { - ltype.funcs[i]=f; + obj.funcs[i] = f; } } // namespace Marklin