]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/timetable.h
Add support for named zones
[r2c2.git] / source / libr2c2 / timetable.h
index 9cfda68df5df05a2876e920169efafe6debf85fd..86b4ae2944c8e21ebb207d49e27e54a946d62dbf 100644 (file)
@@ -17,7 +17,9 @@ Distributed under the GPL
 namespace R2C2 {
 
 class Block;
+class Track;
 class Train;
+class Zone;
 
 class Timetable: public sigc::trackable
 {
@@ -28,18 +30,21 @@ public:
                Loader(Timetable &);
        private:
                void arrive();
-               void go_to(const std::string &);
+               void goto_sensor(unsigned);
+               void goto_sensor(const std::string &);
+               void goto_zone(const std::string &);
                void route(const std::string &);
                void reverse();
                void speed(unsigned);
                void travel(const std::string &);
                void wait(unsigned);
-               void wait_train(unsigned, const std::string &);
+               void wait_train(unsigned, unsigned);
        };
 
        enum RowType
        {
-               GOTO,
+               GOTO_SENSOR,
+               GOTO_ZONE,
                TRAVEL,
                WAIT_TIME,
                WAIT_TRAIN,
@@ -95,7 +100,8 @@ public:
        void tick(const Msp::Time::TimeStamp &);
        void save(std::list<Msp::DataFile::Statement> &) const;
 private:
-       Block &parse_location(const std::string &);
+       Track &get_sensor(unsigned);
+       Zone &get_zone(const std::string &);
        void sensor_event(unsigned, bool);
        void train_arrived();
 };