X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrain.cpp;fp=source%2Flibr2c2%2Ftrain.cpp;h=34b80ddcc39d213635431e50613ecdce29776d51;hb=9ad36841021cdd5c7f14d52e946d8ecdb602cf78;hp=845232fa4d9cf442fc5dddc692c5873291c35302;hpb=9eb22a66345301631994cf24a21af9375d07a172;p=r2c2.git diff --git a/source/libr2c2/train.cpp b/source/libr2c2/train.cpp index 845232f..34b80dd 100644 --- a/source/libr2c2/train.cpp +++ b/source/libr2c2/train.cpp @@ -14,6 +14,7 @@ #include "route.h" #include "simplecontroller.h" #include "speedquantizer.h" +#include "timetable.h" #include "trackcircuit.h" #include "trackiter.h" #include "tracktype.h" @@ -408,6 +409,12 @@ void Train::save(list &st) const router->save(ss.sub); st.push_back(ss); } + else if(Timetable *timetable = dynamic_cast(*i)) + { + DataFile::Statement ss("timetable"); + timetable->save(ss.sub); + st.push_back(ss); + } } } @@ -577,6 +584,7 @@ Train::Loader::Loader(Train &t): add("name", &Loader::name); add("quantized_speed", &Loader::quantized_speed); add("router", &Loader::router); + add("timetable", &Loader::timetable); add("vehicle", &Loader::vehicle); } @@ -612,6 +620,12 @@ void Train::Loader::router() load_sub(*rtr); } +void Train::Loader::timetable() +{ + Timetable *ttbl = new Timetable(obj); + load_sub(*ttbl, obj.layout); +} + void Train::Loader::vehicle(ArticleNumber art_nr) { const VehicleType &vtype = obj.layout.get_catalogue().get(art_nr);