]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/block.cpp
Add Block::has_track and Route::has_track methods
[r2c2.git] / source / libmarklin / block.cpp
index db1942bb5b613fde7ff1b71272383455740bc875..780ee1bbd293e75a9e442f6a83a80c8a38a28f26 100644 (file)
@@ -72,7 +72,12 @@ Block::~Block()
        layout.remove_block(*this);
 }
 
-int Block::get_endpoint_by_link(const Block &other) const
+bool Block::has_track(Track &t) const
+{
+       return tracks.count(&t);
+}
+
+int Block::get_endpoint_by_link(Block &other) const
 {
        for(unsigned i=0; i<endpoints.size(); ++i)
                if(endpoints[i].link==&other)