]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/route.cpp
Change terminology to better distinguish routes on the layout from paths across track...
[r2c2.git] / source / libmarklin / route.cpp
index 364509c8714d4b1aa94fc1340e3f4cbf993181ea..40638d9683051fd3fa4581b14f3d6458d89d4880 100644 (file)
@@ -100,21 +100,21 @@ void Route::update_turnouts()
                                if(unsigned tid2=links[j]->get_turnout_id())
                                {
                                        const Endpoint &ep = links[j]->get_type().get_endpoints()[links[j]->get_endpoint_by_link(**i)];
-                                       int r = get_turnout(tid2);
-                                       if(r>=0 && !(ep.routes&(1<<r)))
+                                       int p = get_turnout(tid2);
+                                       if(p>=0 && !(ep.paths&(1<<p)))
                                        {
-                                               mask &= ~endpoints[j].routes;
+                                               mask &= ~endpoints[j].paths;
                                                continue;
                                        }
                                }
-                               mask &= endpoints[j].routes;
+                               mask &= endpoints[j].paths;
                        }
 
                        if(!(mask&(mask-1)))
                        {
-                               unsigned route = 0;
-                               for(; (mask && !(mask&1)); mask>>=1, ++route) ;
-                               turnouts[tid] = route;
+                               unsigned path = 0;
+                               for(; (mask && !(mask&1)); mask>>=1, ++path) ;
+                               turnouts[tid] = path;
                        }
                        else
                                turnouts[tid] = -1;
@@ -144,7 +144,7 @@ unsigned Route::check_validity(const Track &trk) const
                                int r = get_turnout(tid);
                                if(r>=0)
                                {
-                                       if(endpoints[epi].routes&(1<<r))
+                                       if(endpoints[epi].paths&(1<<r))
                                                result |= 2;
                                }
                                else
@@ -161,7 +161,7 @@ unsigned Route::check_validity(const Track &trk) const
                                        if(count<=1)
                                        {
                                                result |= 2;
-                                               if(epj>=0 && !(endpoints[epi].routes&endpoints[epj].routes))
+                                               if(epj>=0 && !(endpoints[epi].paths&endpoints[epj].paths))
                                                        result &= 3;
                                        }
                                }
@@ -186,9 +186,9 @@ Route::Loader::Loader(Route &r):
        add("turnout", &Loader::turnout);
 }
 
-void Route::Loader::turnout(unsigned id, unsigned route)
+void Route::Loader::turnout(unsigned id, unsigned path)
 {
-       obj.turnouts[id] = route;
+       obj.turnouts[id] = path;
 }
 
 } // namespace Marklin