#include "route.h"
#include "simplecontroller.h"
#include "speedquantizer.h"
+#include "timetable.h"
#include "trackcircuit.h"
#include "trackiter.h"
#include "tracktype.h"
return controller->get_speed();
}
+float Train::get_maximum_speed() const
+{
+ float ms = 0;
+ for(vector<Vehicle *>::const_iterator i=vehicles.begin(); i!=vehicles.end(); ++i)
+ {
+ float vms = (*i)->get_type().get_maximum_speed();
+ if(ms<=0 || (vms>0 && vms<ms))
+ ms = vms;
+ }
+ return ms;
+}
+
bool Train::get_function(unsigned func) const
{
return (functions>>func)&1;
router->save(ss.sub);
st.push_back(ss);
}
+ else if(Timetable *timetable = dynamic_cast<Timetable *>(*i))
+ {
+ DataFile::Statement ss("timetable");
+ timetable->save(ss.sub);
+ st.push_back(ss);
+ }
}
}
add("name", &Loader::name);
add("quantized_speed", &Loader::quantized_speed);
add("router", &Loader::router);
+ add("timetable", &Loader::timetable);
add("vehicle", &Loader::vehicle);
}
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<VehicleType>(art_nr);