X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrain.cpp;h=e9a539a4e77158bc911eebc44c9a437564db4b29;hb=508ee4bfcc0f8fb1373fb7af251c59c873ef896f;hp=b670d4137fc303df68b2e84ade2cc710d5a9c11a;hpb=6eba064c477836843a2647d777e95823a96dda43;p=r2c2.git diff --git a/source/libr2c2/train.cpp b/source/libr2c2/train.cpp index b670d41..e9a539a 100644 --- a/source/libr2c2/train.cpp +++ b/source/libr2c2/train.cpp @@ -5,13 +5,11 @@ #include #include #include -#include "aicontrol.h" #include "beamgate.h" #include "block.h" #include "catalogue.h" #include "driver.h" #include "layout.h" -#include "route.h" #include "simplecontroller.h" #include "speedquantizer.h" #include "timetable.h" @@ -22,7 +20,6 @@ #include "trainrouter.h" #include "vehicle.h" #include "vehicletype.h" -#include "zone.h" using namespace std; using namespace Msp; @@ -385,9 +382,10 @@ void Train::save(list &st) const { st.push_back((DataFile::Statement("name"), name)); + const Catalogue &cat = layout.get_catalogue(); for(vector::const_iterator i=vehicles.begin(); i!=vehicles.end(); ++i) if(i!=vehicles.begin()) - st.push_back((DataFile::Statement("vehicle"), (*i)->get_type().get_article_number())); + st.push_back((DataFile::Statement("vehicle"), cat.get_name(&(*i)->get_type()))); if(speed_quantizer) { @@ -623,9 +621,9 @@ void Train::Loader::timetable() load_sub(*ttbl, obj.layout); } -void Train::Loader::vehicle(ArticleNumber art_nr) +void Train::Loader::vehicle(const string &n) { - const VehicleType &vtype = obj.layout.get_catalogue().get(art_nr); + const VehicleType &vtype = obj.layout.get_catalogue().get(n); Vehicle *veh = new Vehicle(obj.layout, vtype); obj.vehicles.back()->attach_back(*veh); obj.vehicles.push_back(veh);