X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftimetable.h;h=9c9970590ec94245f5cc829d9865834e82779a92;hb=4086edbfae9a04da491cdb349a3bef6af5c132d9;hp=cbbb49b3d9e3d357fa9e24780f834c752ee69123;hpb=598631d530a20ba8f4710f45747a9742e149f604;p=r2c2.git diff --git a/source/libr2c2/timetable.h b/source/libr2c2/timetable.h index cbbb49b..9c99705 100644 --- a/source/libr2c2/timetable.h +++ b/source/libr2c2/timetable.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of R²C² -Copyright © 2010 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #ifndef LIBR2C2_TIMETABLE_H_ #define LIBR2C2_TIMETABLE_H_ @@ -12,16 +5,16 @@ Distributed under the GPL #include #include #include -#include +#include "block.h" +#include "trainai.h" namespace R2C2 { -class Block; class Track; class Train; class Zone; -class Timetable: public sigc::trackable +class Timetable: public TrainAI, public sigc::trackable { public: class Loader: public Msp::DataFile::ObjectLoader @@ -36,6 +29,7 @@ public: void route(const std::string &); void reverse(); void speed(unsigned); + void tag(const std::string &); void travel_to(unsigned); void travel_past(unsigned); void wait(unsigned); @@ -79,7 +73,6 @@ public: }; private: - Train &train; bool enabled; std::vector rows; unsigned current_row; @@ -102,13 +95,13 @@ public: unsigned get_n_rows() const { return rows.size(); } const Row &get_row(unsigned) const; - void tick(const Msp::Time::TimeStamp &); + void tick(const Msp::Time::TimeStamp &, const Msp::Time::TimeDelta &); void save(std::list &) const; private: Track &get_sensor(unsigned); Track &get_turnout(unsigned); Zone &get_zone(const std::string &); - void sensor_event(unsigned, bool); + void block_state_changed(Block &, Block::State); void block_reserved(Block &, Train *); void train_advanced(Block &); void train_arrived();