const map<unsigned, Sensor *> &sensors = trfc_mgr.get_control().get_sensors();
for(map<unsigned, Sensor *>::const_iterator i=sensors.begin(); i!=sensors.end(); ++i)
i->second->signal_state_changed.connect(sigc::bind(sigc::mem_fun(this, &Train::sensor_event), i->second));
const map<unsigned, Sensor *> &sensors = trfc_mgr.get_control().get_sensors();
for(map<unsigned, Sensor *>::const_iterator i=sensors.begin(); i!=sensors.end(); ++i)
i->second->signal_state_changed.connect(sigc::bind(sigc::mem_fun(this, &Train::sensor_event), i->second));
void Train::place(Block *block, unsigned entry)
{
for(list<BlockRef>::iterator i=rsv_blocks.begin(); i!=rsv_blocks.end();)
void Train::place(Block *block, unsigned entry)
{
for(list<BlockRef>::iterator i=rsv_blocks.begin(); i!=rsv_blocks.end();)
+void Train::locomotive_reverse_changed(bool)
+{
+ for(list<BlockRef>::iterator i=rsv_blocks.begin(); i!=rsv_blocks.end(); ++i)
+ i->block->reserve(0);
+ rsv_blocks.clear();
+ cur_blocks.reverse();
+ for(list<BlockRef>::iterator i=cur_blocks.begin(); i!=cur_blocks.end(); ++i)
+ i->entry = i->block->traverse(i->entry);
+ reserve_more();
+ update_speed();
+}
+
void Train::sensor_event(bool state, Sensor *sensor)
{
unsigned addr = sensor->get_address();
void Train::sensor_event(bool state, Sensor *sensor)
{
unsigned addr = sensor->get_address();