X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrain.h;h=c0eb52e850006cd4ca48f41f1ad35dd77da227f3;hb=9f4f169affcedcf249e935f93e0a15ed60232f6a;hp=42bbc375b25b1346fc55b457b04cf41ca45dab22;hpb=5c1ddd2f213af3fea15237e02f7da112c0abba36;p=r2c2.git diff --git a/source/libr2c2/train.h b/source/libr2c2/train.h index 42bbc37..c0eb52e 100644 --- a/source/libr2c2/train.h +++ b/source/libr2c2/train.h @@ -4,15 +4,16 @@ #include #include #include -#include -#include "block.h" +#include #include "blockallocator.h" #include "controller.h" +#include "sensor.h" #include "trainai.h" namespace R2C2 { class ArticleNumber; +class Block; class SpeedQuantizer; class Vehicle; class VehicleType; @@ -34,7 +35,6 @@ public: void name(const std::string &); void quantized_speed(); void router(); - void timetable(); void vehicle(ArticleNumber); }; @@ -60,11 +60,11 @@ private: unsigned current_speed_step; bool speed_changing; bool reverse; - Msp::Time::TimeStamp stop_timeout; + Msp::Time::TimeDelta stop_timeout; unsigned functions; BlockIter last_entry_block; - Msp::Time::TimeStamp last_entry_time; + Msp::Time::TimeDelta travel_time; bool pure_speed; SpeedQuantizer *speed_quantizer; bool accurate_position; @@ -123,14 +123,14 @@ public: const BlockAllocator &get_block_allocator() const { return allocator; } float get_reserved_distance() const; - void tick(const Msp::Time::TimeStamp &, const Msp::Time::TimeDelta &); + void tick(const Msp::Time::TimeDelta &); void save(std::list &) const; private: void control_changed(const Controller::Control &); void loco_speed_event(unsigned, unsigned, bool); void loco_func_event(unsigned, unsigned, bool); - void block_state_changed(Block &, Block::State); + void sensor_state_changed(Sensor &, Sensor::State); void halt_event(bool); void block_reserved(const Block &, const Train *); float get_reserved_distance_until(const Block *) const;