]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/catalogue.cpp
Full vehicle unification
[r2c2.git] / source / libmarklin / catalogue.cpp
index 286407cc09326818973d5a7c18593ac81108efb9..fca6045fc38da36c5613758fd205f95c1a5f791a 100644 (file)
@@ -8,8 +8,8 @@ Distributed under the GPL
 #include <msp/core/refptr.h>
 #include <msp/datafile/parser.h>
 #include "catalogue.h"
-#include "locotype.h"
 #include "tracktype.h"
+#include "vehicletype.h"
 
 using namespace std;
 using namespace Msp;
@@ -66,15 +66,6 @@ const VehicleType &Catalogue::get_vehicle(unsigned art_nr) const
        return *i->second;
 }
 
-const LocoType &Catalogue::get_locomotive(unsigned art_nr) const
-{
-       const VehicleType &veh = get_vehicle(art_nr);
-       if(const LocoType *loco = dynamic_cast<const LocoType *>(&veh))
-               return *loco;
-       
-       throw Exception("Vehicle is not a locomotive");
-}
-
 
 Catalogue::Loader::Loader(Catalogue &c):
        DataFile::BasicLoader<Catalogue>(c)
@@ -82,7 +73,6 @@ Catalogue::Loader::Loader(Catalogue &c):
        add("ballast_profile", &Loader::ballast_profile);
        add("gauge", &Loader::gauge);
        add("layout", &Loader::layout);
-       add("locomotive", &Loader::locomotive);
        add("rail_profile", &Loader::rail_profile);
        add("scale", &Loader::scale);
        add("track", &Loader::track);
@@ -107,14 +97,6 @@ void Catalogue::Loader::layout()
        load_sub(obj.layout);
 }
 
-void Catalogue::Loader::locomotive(unsigned art_nr)
-{
-       RefPtr<LocoType> loco = new LocoType(art_nr);
-       load_sub(*loco);
-       obj.add_vehicle(*loco);
-       loco.release();
-}
-
 void Catalogue::Loader::rail_profile()
 {
        load_sub(obj.rail_profile);