X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Flayout.h;h=2211de04987b031eb58fc83c4e289aae35140abb;hb=d0881a98a6240758ac1aeceaa9443d718ab1ad5c;hp=5a0804fc77329b1c8714b3ce2d27112d1ff14b13;hpb=399b48a7a80dafde49e7530ff8dfd2820232a73f;p=r2c2.git diff --git a/source/libr2c2/layout.h b/source/libr2c2/layout.h index 5a0804f..2211de0 100644 --- a/source/libr2c2/layout.h +++ b/source/libr2c2/layout.h @@ -5,6 +5,7 @@ #include #include #include +#include #include #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(); }; @@ -68,14 +70,6 @@ private: void del(); }; - struct BlockReservation - { - Block █ - Train *train; - - BlockReservation(Block &, Train *); - }; - public: typedef std::vector ZoneArray; @@ -100,8 +94,6 @@ private: std::map trains; Msp::Time::TimeStamp last_tick; unsigned next_turnout_addr; - bool emitting_block_reserved; - std::deque block_reserve_queue; public: Layout(Catalogue &, Driver * = 0); @@ -149,14 +141,16 @@ public: const std::map &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; void save_dynamic(const std::string &) const; private: void sensor_state_changed(Sensor &, Sensor::State); - void block_reserved(Block &, Train *); }; } // namespace R2C2