]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/route.cpp
Update #includes that have been renamed, and remove stray ones
[r2c2.git] / source / libr2c2 / route.cpp
index 4f7e778441bdf2e03aa9b12cfeb9b96e677cdaf5..58e50ddc7fb9fb3b39109f3a68dceb02fd2e7dd7 100644 (file)
@@ -1,17 +1,11 @@
-/* $Id$
-
-This file is part of R²C²
-Copyright © 2007-2010  Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
 #include <queue>
-#include <msp/strings/formatter.h>
+#include <msp/strings/format.h>
 #include "layout.h"
 #include "route.h"
 #include "track.h"
 #include "trackiter.h"
 #include "tracktype.h"
+#include "zone.h"
 
 using namespace std;
 using namespace Msp;
@@ -364,7 +358,7 @@ unsigned Route::check_validity(Track &trk) const
                                                        const TrackType::Endpoint &ep2 = tlinks[j]->get_type().get_endpoint(tlinks[j]->get_endpoint_by_link(**i));
                                                        path = get_turnout(tid2);
                                                        // Ignore a linked turnout with some other path set
-                                                       if(path>0 && !(ep2.paths&(1<<path)))
+                                                       if(path>=0 && !(ep2.paths&(1<<path)))
                                                                continue;
                                                }
 
@@ -404,6 +398,11 @@ Route *Route::find(const TrackIter &from, const Route &to)
        return create_route(from, TrackInSet(to.get_tracks()));
 }
 
+Route *Route::find(const TrackIter &from, const Zone &to)
+{
+       return create_route(from, TrackInSet(to.get_tracks()));
+}
+
 Route *Route::find(const TrackIter &from, const set<Track *> &to)
 {
        return create_route(from, TrackInSet(to));