/* $Id$
This file is part of R²C²
-Copyright © 2010 Mikkosoft Productions, Mikko Rasa
+Copyright © 2010-2011 Mikkosoft Productions, Mikko Rasa
Distributed under the GPL
*/
namespace R2C2 {
class Block;
+class Track;
class Train;
+class Zone;
class Timetable: public sigc::trackable
{
Loader(Timetable &);
private:
void arrive();
- void go_to(const std::string &);
+ void goto_sensor(unsigned);
+ void goto_sensor_str(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_to(unsigned);
+ void travel_past(unsigned);
void wait(unsigned);
- void wait_train(unsigned, const std::string &);
+ void wait_train(unsigned, unsigned);
+ void wait_until(unsigned, unsigned);
};
enum RowType
{
- GOTO,
- TRAVEL,
+ GOTO_SENSOR,
+ GOTO_ZONE,
+ TRAVEL_TO,
+ TRAVEL_PAST,
WAIT_TIME,
+ WAIT_UNTIL,
WAIT_TRAIN,
ARRIVE,
SPEED,
Block *pending_block;
Train *pending_train;
Msp::Time::TimeStamp wait_timeout;
+ bool arrived;
public:
Timetable(Train &);
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);
+ Track &get_turnout(unsigned);
+ Zone &get_zone(const std::string &);
void sensor_event(unsigned, bool);
+ void block_reserved(Block &, Train *);
+ void train_advanced(Block &);
void train_arrived();
};