X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftrack.cpp;h=aeccaa697e4bc29a3e8b341737401200bd5bd82e;hb=9a2fd67cec715e371e293be638b126e0d1b2148d;hp=b53342c645c6d71e77ab3727e9833908835bf228;hpb=3dfcd6a470a96dc7b6f2f100e604c7f0db6da00c;p=r2c2.git diff --git a/source/libr2c2/track.cpp b/source/libr2c2/track.cpp index b53342c..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()) { @@ -187,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())