3 This file is part of R²C²
4 Copyright © 2011 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
8 #ifndef LIBR2C2_TRAINAI_H_
9 #define LIBR2C2_TRAINAI_H_
12 #include <sigc++/signal.h>
13 #include <msp/core/variant.h>
14 #include <msp/time/timedelta.h>
15 #include <msp/time/timestamp.h>
22 Base class for train AIs.
24 AIs can help the user in various ways, ranging from automatically stopping the
25 train at the end of allocated track to autonomously running a train.
27 XXX The timestamp should be removed from tick, but Timetable depends on it
37 Message(const std::string &t): type(t) { }
40 Message(const std::string &t, const T &v): type(t), value(v) { }
43 sigc::signal<void, const Message &> signal_event;
53 void set_tag(const std::string &);
54 const std::string &get_tag() const { return tag; }
56 virtual void message(const Message &) { }
57 virtual void tick(const Msp::Time::TimeStamp &, const Msp::Time::TimeDelta &) { }