namespace R2C2 {
class Layout;
-class Zone;
+class TrackChain;
class Timetable: public TrainAI
{
enum RowType
{
ARRIVE = 1,
- DEPART
+ DEPART,
+ THROUGH
};
struct Row
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();
void save(std::list<Msp::DataFile::Statement> &) const;
};
+ struct RowTypeMatch
+ {
+ RowType type;
+
+ RowTypeMatch(RowType t): type(t) { }
+
+ bool operator()(const Row &r) const { return r.type==type; }
+ };
+
sigc::signal<void, unsigned, const Row &> signal_row_added;
sigc::signal<void, unsigned, const Row &> signal_row_modified;
sigc::signal<void, unsigned> signal_row_removed;
private:
void check_update(std::list<Row>::const_iterator);
+ std::list<Row>::iterator find_trip(const std::list<Row>::iterator &, std::list<Row>::iterator *);
void update_route();
void event(TrainAI &, const Message &);
+ void record_time();
};
} // namespace R2C2