X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Fblock.cpp;h=9a9164ea292770380548aea3a2c517ac4fbe327d;hb=684cf3b8c41e9bb60b2d286bd6d632b0c5abf0ab;hp=c562788811a05ec07bc4997a8df6d6b49cf14a16;hpb=38fb8d56efde037a71c46a58bda314655e68ab6c;p=r2c2.git diff --git a/source/libmarklin/block.cpp b/source/libmarklin/block.cpp index c562788..9a9164e 100644 --- a/source/libmarklin/block.cpp +++ b/source/libmarklin/block.cpp @@ -52,10 +52,10 @@ Block::Block(TrafficManager &tm, Track &start): for(unsigned i=0; i visited; - find_routes(*endpoints[i].track, endpoints[i].track_ep, route, visited); + find_paths(*endpoints[i].track, endpoints[i].track_ep, path, visited); } } @@ -82,18 +82,18 @@ int Block::traverse(unsigned epi, float *len) const while(1) { - unsigned cur_route = 0; + unsigned cur_path = 0; unsigned tid = track->get_turnout_id(); if(tid) { Turnout &turnout = trfc_mgr.get_control().get_turnout(tid); - cur_route = turnout.get_route(); + cur_path = turnout.get_path(); } if(len) - *len += track->get_type().get_route_length(cur_route); + *len += track->get_type().get_path_length(cur_path); - int other_ep = track->traverse(track_ep, cur_route); + int other_ep = track->traverse(track_ep, cur_path); if(other_ep<0) return -1; @@ -157,11 +157,11 @@ void Block::print_debug() cout<link->id; else cout<<"none"; - cout<<", routes="<routes<<'\n'; + cout<<", paths="<paths<<'\n'; } } -void Block::find_routes(Track &track, unsigned track_ep, unsigned route, set &visited) +void Block::find_paths(Track &track, unsigned track_ep, unsigned path, set &visited) { visited.insert(&track); @@ -172,15 +172,15 @@ void Block::find_routes(Track &track, unsigned track_ep, unsigned route, setget_endpoint_by_link(track), route, visited); + find_paths(*link, link->get_endpoint_by_link(track), path, visited); else { for(vector::iterator j=endpoints.begin(); j!=endpoints.end(); ++j) if(j->track==&track && j->track_ep==i) - j->routes |= route; + j->paths |= path; } } } @@ -190,7 +190,7 @@ Block::Endpoint::Endpoint(Track *t, unsigned e): track(t), track_ep(e), link(0), - routes(0) + paths(0) { } } // namespace Marklin