X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrainrouter.cpp;h=508a7b19651a4835206a0c76f1b2d8e9c90eeaaa;hb=9b92c1f33c142ea8e47e2239742f2f603a7e3861;hp=93dbedf544c27b029a56dc352f1f9e6e502be4ad;hpb=d578d036656c0e89fe9dca5aefd1f81d2777a69e;p=r2c2.git diff --git a/source/libr2c2/trainrouter.cpp b/source/libr2c2/trainrouter.cpp index 93dbedf..508a7b1 100644 --- a/source/libr2c2/trainrouter.cpp +++ b/source/libr2c2/trainrouter.cpp @@ -80,6 +80,17 @@ bool TrainRouter::set_route(const Route *r) return true; } +bool TrainRouter::add_route(const Route &r) +{ + if(routes.empty()) + return set_route(&r); + + // TODO Check that it can be reached from previous routes + routes.push_back(&r); + + return true; +} + void TrainRouter::add_wait(Block &block, Train *tr) { Wait wait;