]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/layout.cpp
Change terminology to better distinguish routes on the layout from paths across track...
[r2c2.git] / source / libmarklin / layout.cpp
index 9ec0d0aff852982cca868bd5399343bae3660a51..3a6b6302d56ebf806c442ce8f8c808fb903a5091 100644 (file)
@@ -108,14 +108,14 @@ void Layout::check_routes()
                const map<unsigned, int> turnouts = (*i)->get_turnouts();
 
                Track *track = 0;
-               unsigned trk_route = 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_route = k->second;
+                               trk_path = k->second;
                                break;
                        }
                }
@@ -125,7 +125,7 @@ void Layout::check_routes()
                const vector<Endpoint> &eps = track->get_type().get_endpoints();
                unsigned ep = 0;
                for(unsigned j=0; j<eps.size(); ++i)
-                       if(eps[j].routes&(1<<trk_route))
+                       if(eps[j].paths&(1<<trk_path))
                        {
                                ep = j;
                                break;
@@ -134,22 +134,22 @@ void Layout::check_routes()
                Track *start = track;
                while(1)
                {
-                       int out_ep = track->traverse(ep, trk_route);
+                       int out_ep = track->traverse(ep, trk_path);
                        if(out_ep<0)
                                break;
                        Track *next = track->get_links()[out_ep];
                        if(!next || next == start)
                                break;
                        ep = next->get_endpoint_by_link(*track);
-                       if(next->get_type().get_n_routes()>1)
+                       if(next->get_type().get_n_paths()>1)
                        {
                                map<unsigned, int>::const_iterator j = turnouts.find(next->get_turnout_id());
                                if(j==turnouts.end())
                                        break;
-                               trk_route = j->second;
+                               trk_path = j->second;
                        }
                        else
-                               trk_route = 0;
+                               trk_path = 0;
                        (*i)->add_track(*next);
                        track = next;
                }