X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftimetable.cpp;h=44e859e9a5b9becbb3d943adc8bb198287428f1a;hb=1c072afdb1866ba397ee8e6155f5f68c6c7ab4da;hp=753aae83f719a2f453605a78f6dac417a7bcec30;hpb=0db89b665527609582df98854c9e3255d1017811;p=r2c2.git diff --git a/source/libr2c2/timetable.cpp b/source/libr2c2/timetable.cpp index 753aae8..44e859e 100644 --- a/source/libr2c2/timetable.cpp +++ b/source/libr2c2/timetable.cpp @@ -88,15 +88,15 @@ void Timetable::tick(const Time::TimeStamp &t, const Time::TimeDelta &) { case GOTO_SENSOR: arrived = false; - train.ai_message(Message("go-to-track", &get_sensor(row.get_param(0)))); + train.ai_message(Message("set-destination-block", &get_sensor(row.get_param(0)))); break; case GOTO_ZONE: arrived = false; - train.ai_message(Message("go-to-zone", &get_zone(row.get_param(0)))); + train.ai_message(Message("set-destination-zone", &get_zone(row.get_param(0)))); break; case TRAVEL_TO: { - Block *block = &get_sensor(row.get_param(0)).get_block(); + Block *block = &get_sensor(row.get_param(0)); if(block->get_train()!=&train || block->get_state()(0)); - Block *block = &get_sensor(row.get_param(1)).get_block(); + Block *block = &get_sensor(row.get_param(1)); if(block->get_train()!=other_train || block->get_state() &st) const st.push_back(i->save()); } -Track &Timetable::get_sensor(unsigned id) +Block &Timetable::get_sensor(unsigned id) { - Block &block = train.get_layout().get_block(id|0x1000); - return **block.get_tracks().begin(); + return train.get_layout().get_block(id|0x1000); } Track &Timetable::get_turnout(unsigned id)