]> git.tdb.fi Git - r2c2.git/blob - source/libr2c2/simplecontroller.h
Rename the project to R²C²
[r2c2.git] / source / libr2c2 / simplecontroller.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_SIMPLECONTROLLER_H_
9 #define LIBR2C2_SIMPLECONTROLLER_H_
10
11 #include <string>
12 #include "controller.h"
13
14 namespace R2C2 {
15
16 class SimpleController: public Controller
17 {
18 private:
19         Control target_speed;
20         Control reverse;
21         float accel;
22         float speed;
23
24 public:
25         SimpleController();
26
27         virtual void set_control(const std::string &, float);
28         virtual const Control &get_control(const std::string &) const;
29
30         virtual float get_speed() const { return speed; }
31         virtual bool get_reverse() const { return reverse.value; }
32         virtual float get_braking_distance() const;
33
34         virtual void tick(const Msp::Time::TimeDelta &);
35 };
36
37 } // namespace R2C2
38
39 #endif