]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/layout.h
Remove a queued block reservation if the block is released
[r2c2.git] / source / libr2c2 / layout.h
index 5a0804fc77329b1c8714b3ce2d27112d1ff14b13..e06d4fb04f50d8ccb1e581a363e2dce18d13d91a 100644 (file)
@@ -5,6 +5,7 @@
 #include <set>
 #include <sigc++/sigc++.h>
 #include <msp/datafile/objectloader.h>
+#include <msp/time/timedelta.h>
 #include <msp/time/timestamp.h>
 #include "geometry.h"
 #include "sensor.h"
@@ -41,7 +42,8 @@ public:
                void terrain(const std::string &);
                void track(const std::string &);
                void train(const std::string &, unsigned, const std::string &);
-               void turnout(unsigned, unsigned);
+               void turnout(unsigned);
+               void turnout2(unsigned, unsigned);
                void zone();
        };
 
@@ -70,7 +72,7 @@ private:
 
        struct BlockReservation
        {
-               Block &block;
+               Block *block;
                Train *train;
 
                BlockReservation(Block &, Train *);
@@ -149,7 +151,10 @@ public:
        const std::map<unsigned, Train *> &get_trains() const { return trains; }
        void remove_train(Train &);
 
-       void tick();
+       void tick(float = 1.0f);
+private:
+       void step(const Msp::Time::TimeDelta &);
+public:
        void emergency(Block *, const std::string &);
 
        void save(const std::string &) const;