1 #ifndef LIBR2C2_TRAINAI_H_
2 #define LIBR2C2_TRAINAI_H_
5 #include <sigc++/signal.h>
6 #include <msp/core/variant.h>
7 #include <msp/time/timedelta.h>
8 #include <msp/time/timestamp.h>
15 Base class for train AIs.
17 AIs can help the user in various ways, ranging from automatically stopping the
18 train at the end of allocated track to autonomously running a train.
20 XXX The timestamp should be removed from tick, but Timetable depends on it
30 Message(const std::string &t): type(t) { }
33 Message(const std::string &t, const T &v): type(t), value(v) { }
36 sigc::signal<void, const Message &> signal_event;
45 virtual void message(const Message &) { }
46 virtual void tick(const Msp::Time::TimeStamp &, const Msp::Time::TimeDelta &) { }