- /* We must copy the turnout map, since adding tracks to the route will
- (temporarily) mess it up */
- const map<unsigned, int> turnouts = i->second->get_turnouts();
-
- // Find any turnout in the route
- Track *track = 0;
- unsigned trk_path = 0;
- for(set<Track *>::const_iterator j=tracks.begin(); j!=tracks.end(); ++j)
- {
- map<unsigned, int>::const_iterator k = turnouts.find((*j)->get_turnout_id());
- if(k!=turnouts.end())
- {
- track = *j;
- trk_path = k->second;
- break;
- }
- }
-
- if(!track)
- continue;
-
- // Find an applicable endpoint
- const vector<Endpoint> &eps = track->get_type().get_endpoints();
- unsigned ep = 0;
- for(unsigned j=0; j<eps.size(); ++j)
- if(eps[j].paths&(1<<trk_path))
+ for(set<Block *>::iterator i=blocks.begin(); i!=blocks.end(); ++i)
+ if((*i)->get_sensor_id()==addr)