]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/aicontrol.h
Rename the project to R²C²
[r2c2.git] / source / libr2c2 / aicontrol.h
diff --git a/source/libr2c2/aicontrol.h b/source/libr2c2/aicontrol.h
new file mode 100644 (file)
index 0000000..0d84218
--- /dev/null
@@ -0,0 +1,47 @@
+/* $Id$
+
+This file is part of R²C²
+Copyright © 2010  Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
+#ifndef LIBR2C2_AICONTROL_H_
+#define LIBR2C2_AICONTROL_H_
+
+#include <sigc++/trackable.h>
+#include "controller.h"
+
+namespace R2C2 {
+
+class Train;
+
+class AIControl: public Controller, public sigc::trackable
+{
+private:
+       Train &train;
+       Controller *next_ctrl;
+       Control target_speed;
+       bool blocked;
+       bool approach;
+
+public:
+       AIControl(Train &, Controller *);
+       virtual ~AIControl();
+
+       virtual void set_control(const std::string &, float);
+       virtual const Control &get_control(const std::string &) const;
+
+       virtual float get_speed() const;
+       virtual bool get_reverse() const;
+       virtual float get_braking_distance() const;
+
+       virtual void tick(const Msp::Time::TimeDelta &);
+
+private:
+       void control_changed(const Control &);
+       void arrived();
+};
+
+} // namespace R2C2
+
+#endif