]> git.tdb.fi Git - r2c2.git/blob - source/libr2c2/aicontrol.h
Rename the project to R²C²
[r2c2.git] / source / libr2c2 / aicontrol.h
1 /* $Id$
2
3 This file is part of R²C²
4 Copyright © 2010  Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef LIBR2C2_AICONTROL_H_
9 #define LIBR2C2_AICONTROL_H_
10
11 #include <sigc++/trackable.h>
12 #include "controller.h"
13
14 namespace R2C2 {
15
16 class Train;
17
18 class AIControl: public Controller, public sigc::trackable
19 {
20 private:
21         Train &train;
22         Controller *next_ctrl;
23         Control target_speed;
24         bool blocked;
25         bool approach;
26
27 public:
28         AIControl(Train &, Controller *);
29         virtual ~AIControl();
30
31         virtual void set_control(const std::string &, float);
32         virtual const Control &get_control(const std::string &) const;
33
34         virtual float get_speed() const;
35         virtual bool get_reverse() const;
36         virtual float get_braking_distance() const;
37
38         virtual void tick(const Msp::Time::TimeDelta &);
39
40 private:
41         void control_changed(const Control &);
42         void arrived();
43 };
44
45 } // namespace R2C2
46
47 #endif