]> git.tdb.fi Git - r2c2.git/commitdiff
Correct ordering of some functions
authorMikko Rasa <tdb@tdb.fi>
Mon, 6 May 2013 16:49:24 +0000 (19:49 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 6 May 2013 17:23:03 +0000 (20:23 +0300)
source/libr2c2/layout.cpp

index fefa3e9b3fb4045e2d6ecf84280c0319fa2431ed..a4c7309e472fc30d122b0a532508813cf212be37 100644 (file)
@@ -72,6 +72,15 @@ void Layout::add_track(Track &t)
        }
 }
 
+Track *Layout::pick_track(const Vector &start, const Vector &ray)
+{
+  for(set<Track *>::iterator i=tracks.begin(); i!=tracks.end(); ++i)
+     if((*i)->collide_ray(start, ray))
+        return *i;
+
+       return 0;
+}
+
 void Layout::remove_track(Track &t)
 {
        if(tracks.erase(&t))
@@ -81,27 +90,6 @@ void Layout::remove_track(Track &t)
        }
 }
 
-void Layout::add_signal(Signal &s)
-{
-       if(signals.insert(&s).second)
-               signal_signal_added.emit(s);
-}
-
-void Layout::remove_signal(Signal &s)
-{
-       if(signals.erase(&s))
-               signal_signal_removed.emit(s);
-}
-
-Track *Layout::pick_track(const Vector &start, const Vector &ray)
-{
-       for(set<Track *>::iterator i=tracks.begin(); i!=tracks.end(); ++i)
-               if((*i)->collide_ray(start, ray))
-                       return *i;
-
-       return 0;
-}
-
 unsigned Layout::allocate_turnout_id()
 {
        set<unsigned> used_ids;
@@ -117,6 +105,18 @@ unsigned Layout::allocate_turnout_id()
        return result;
 }
 
+void Layout::add_signal(Signal &s)
+{
+       if(signals.insert(&s).second)
+               signal_signal_added.emit(s);
+}
+
+void Layout::remove_signal(Signal &s)
+{
+       if(signals.erase(&s))
+               signal_signal_removed.emit(s);
+}
+
 void Layout::add_block(Block &b)
 {
        blocks.insert(&b);