X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrack.cpp;h=aeccaa697e4bc29a3e8b341737401200bd5bd82e;hb=bb7e754473aea2083c406b94060b9982c66f7473;hp=0411f1586c86fd89bc21f3be534905f363995dec;hpb=08dea8dfcf923e9296bcd3910455540895d0439b;p=r2c2.git diff --git a/source/libr2c2/track.cpp b/source/libr2c2/track.cpp index 0411f15..aeccaa6 100644 --- a/source/libr2c2/track.cpp +++ b/source/libr2c2/track.cpp @@ -38,7 +38,8 @@ Track::Track(Layout &l, const TrackType &t): sensor_addr(0), links(type.get_endpoints().size()), active_path(0), - path_changing(false) + path_changing(false), + preferred_exit(-1) { if(type.is_turnout()) { @@ -55,7 +56,6 @@ Track::Track(Layout &l, const TrackType &t): layout.add(*this); - for(unsigned paths = type.get_paths(); !(paths&1); ++active_path, paths>>=1) ; } @@ -188,6 +188,11 @@ void Track::set_sensor_address(unsigned a) layout.create_blocks(*this); } +void Track::set_preferred_exit(int e) +{ + preferred_exit = e; +} + void Track::set_active_path(unsigned p) { if(!type.is_turnout())