]> git.tdb.fi Git - r2c2.git/blob - source/libmarklin/controlmodel.h
Foundations of using physics simulation for trains
[r2c2.git] / source / libmarklin / controlmodel.h
1 /* $Id$
2
3 This file is part of the MSP Märklin suite
4 Copyright © 2010  Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef LIBMARKLIN_CONTROLMODEL_H_
9 #define LIBMARKLIN_CONTROLMODEL_H_
10
11 #include <string>
12 #include <msp/time/timedelta.h>
13
14 namespace Marklin {
15
16 class TrainControl;
17
18 class ControlModel
19 {
20 protected:
21         ControlModel() { }
22 public:
23         virtual ~ControlModel() { }
24
25         virtual void set_control(const std::string &, float) = 0;
26         virtual const TrainControl &get_control(const std::string &) const = 0;
27
28         virtual float get_speed() const = 0;
29         virtual float get_braking_distance() const = 0;
30
31         virtual void tick(const Msp::Time::TimeDelta &) = 0;
32 };
33
34 } // namespace Marklin
35
36 #endif