X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftimetable.h;h=9ec804e0692d02834c72fa2de50bdb4fc6f0c795;hb=8a2b5c1ac2fc07e280dc678165d2ca58f7d07e32;hp=b67e5fb3c2baa4761b639dae6a55e3902795e014;hpb=9ad36841021cdd5c7f14d52e946d8ecdb602cf78;p=r2c2.git diff --git a/source/libr2c2/timetable.h b/source/libr2c2/timetable.h index b67e5fb..9ec804e 100644 --- a/source/libr2c2/timetable.h +++ b/source/libr2c2/timetable.h @@ -7,7 +7,7 @@ namespace R2C2 { class Layout; -class Zone; +class TrackChain; class Timetable: public TrainAI { @@ -27,7 +27,8 @@ public: enum RowType { ARRIVE = 1, - DEPART + DEPART, + THROUGH }; struct Row @@ -41,12 +42,13 @@ public: Loader(Row &, Layout &); private: - void zone(const std::string &, unsigned); + void block(unsigned); void time(Msp::Time::RawTime); + void zone(const std::string &, unsigned); }; RowType type; - Zone *zone; + TrackChain *target; Msp::Time::TimeDelta time; Row(); @@ -54,6 +56,15 @@ public: void save(std::list &) const; }; + struct RowTypeMatch + { + RowType type; + + RowTypeMatch(RowType t): type(t) { } + + bool operator()(const Row &r) const { return r.type==type; } + }; + sigc::signal signal_row_added; sigc::signal signal_row_modified; sigc::signal signal_row_removed; @@ -62,6 +73,7 @@ private: std::list rows; std::list::iterator current_row; bool update_pending; + bool sync_to_clock; public: Timetable(Train &); @@ -79,9 +91,11 @@ public: void save(std::list &) const; private: - void check_update(std::list::const_iterator); + void check_update(const std::list::const_iterator &); + std::list::iterator find_trip(const std::list::iterator &, std::list::iterator *); void update_route(); void event(TrainAI &, const Message &); + void record_time(); }; } // namespace R2C2