X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Flibr2c2%2Ftrainrouter.cpp;h=508a7b19651a4835206a0c76f1b2d8e9c90eeaaa;hb=b68d1d4f2be93a405170e7caca05760ca473dcc6;hp=93dbedf544c27b029a56dc352f1f9e6e502be4ad;hpb=df99c7e41d87084fe7f71729f3df33d7effc59cc;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;