]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/train.h
Move speed quantization into a separate class
[r2c2.git] / source / libr2c2 / train.h
index 48ee867a597c7c22e56045dc88df27a7b29bf88c..b72fbf635c1d613c8e7f4aab07333dc4fb29eed3 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of R²C²
-Copyright © 2006-2010  Mikkosoft Productions, Mikko Rasa
+Copyright © 2006-2011  Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
@@ -19,6 +19,7 @@ namespace R2C2 {
 
 class ArticleNumber;
 class Route;
+class SpeedQuantizer;
 class Timetable;
 class Vehicle;
 class VehicleType;
@@ -40,7 +41,7 @@ public:
                void block(unsigned);
                void block_hint(unsigned);
                void name(const std::string &);
-               void real_speed(unsigned, float, float);
+               void quantized_speed();
                void route(const std::string &);
                void timetable();
                void vehicle(ArticleNumber);
@@ -63,15 +64,6 @@ private:
                RouteRef(const Route *, unsigned = 0);
        };
 
-       struct RealSpeed
-       {
-               float speed;
-               float weight;
-
-               RealSpeed();
-               void add(float, float);
-       };
-
        typedef std::list<BlockIter> BlockList;
 
        Layout &layout;
@@ -104,7 +96,7 @@ private:
        Msp::Time::TimeStamp last_entry_time;
        float travel_dist;
        bool pure_speed;
-       std::vector<RealSpeed> real_speed;
+       SpeedQuantizer *speed_quantizer;
        bool accurate_position;
        float overshoot_dist;