X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftimetable.h;h=8f64ad1c1f1ec828c81f4a7691aff1cf40b6bbee;hb=895f5a36ee5a4fcba95ad88b7a197bf61f1f501d;hp=9cfda68df5df05a2876e920169efafe6debf85fd;hpb=1ff06c5bc46a677fa389ef86c6b26664368f1653;p=r2c2.git diff --git a/source/libr2c2/timetable.h b/source/libr2c2/timetable.h index 9cfda68..8f64ad1 100644 --- a/source/libr2c2/timetable.h +++ b/source/libr2c2/timetable.h @@ -17,7 +17,9 @@ Distributed under the GPL namespace R2C2 { class Block; +class Track; class Train; +class Zone; class Timetable: public sigc::trackable { @@ -28,20 +30,25 @@ 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 travel(unsigned); void wait(unsigned); - void wait_train(unsigned, const std::string &); + void wait_train(unsigned, unsigned); + void wait_until(unsigned, unsigned); }; enum RowType { - GOTO, + GOTO_SENSOR, + GOTO_ZONE, TRAVEL, WAIT_TIME, + WAIT_UNTIL, WAIT_TRAIN, ARRIVE, SPEED, @@ -78,6 +85,7 @@ private: Block *pending_block; Train *pending_train; Msp::Time::TimeStamp wait_timeout; + bool arrived; public: Timetable(Train &); @@ -95,7 +103,8 @@ public: void tick(const Msp::Time::TimeStamp &); void save(std::list &) 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(); };