int route_path = route->route->get_turnout(from.get_turnout_id());
// Check that more than one path is available
- unsigned ep_paths = track->get_type().get_endpoints()[track.entry()].paths;
+ unsigned ep_paths = track.endpoint().paths;
if(!(ep_paths&(ep_paths-1)))
return false;
}
else
{
- const Block::Endpoint &bep = block.get_endpoints()[entry];
+ const Block::Endpoint &bep = block.get_endpoint(entry);
vehicles.back()->place(*bep.track, bep.track_ep, 0, Vehicle::BACK_BUFFER);
}
}
// Check if we've reached the next route
if(routes.size()>1)
{
- const set<Track *> &rtracks = (++routes.begin())->route->get_tracks();
+ const Route &route = *(++routes.begin())->route;
for(BlockList::iterator j=cur_blocks_end; j!=end; ++j)
- if(rtracks.count((*j)->get_endpoints()[j->entry()].track))
+ if(route.has_track(*j->track_iter()))
{
routes.pop_front();
// XXX Exceptions?
if(block->get_turnout_id())
{
- const TrackType::Endpoint &track_ep = track->get_type().get_endpoints()[track.entry()];
+ const TrackType::Endpoint &track_ep = track.endpoint();
bool multiple_paths = (track_ep.paths&(track_ep.paths-1));
if(multiple_paths && cur_route!=routes.end() && cur_route->diversion!=block->get_turnout_id())
if((*i)->get_turnout_id())
{
TrackIter track = i->track_iter();
- const TrackType::Endpoint &track_ep = track->get_type().get_endpoints()[track.entry()];
+ const TrackType::Endpoint &track_ep = track.endpoint();
unsigned path = 0;
list<BlockIter>::iterator j = i;
if(++j!=blocks.end())
{
TrackIter rev = j->track_iter().flip();
- unsigned mask = rev->get_type().get_endpoints()[rev.entry()].paths&track_ep.paths;
+ unsigned mask = rev.endpoint().paths&track_ep.paths;
for(path=0; mask>1; mask>>=1, ++path) ;
}
else