#include <msp/time/units.h>
#include <msp/time/utils.h>
#include "aicontrol.h"
+#include "beamgate.h"
#include "block.h"
#include "catalogue.h"
#include "driver.h"
vehicles.front()->place(track, 0, Vehicle::FRONT_AXLE);
}
}
+ else if(BeamGate *gate = dynamic_cast<BeamGate *>(&sensor))
+ {
+ if(!advancing && vehicles.front()->get_track())
+ {
+ TrackIter track = allocator.iter_for(*block).track_iter();
+ for(; (track && &track->get_block()==block); track=track.next())
+ if(track.track()==gate->get_track())
+ {
+ if(reverse)
+ track = track.reverse();
+ float offset = gate->get_offset_from_endpoint(track.entry());
+ if(reverse)
+ vehicles.back()->place(track, offset, Vehicle::BACK_BUFFER);
+ else
+ vehicles.front()->place(track, offset, Vehicle::FRONT_BUFFER);
+ break;
+ }
+ }
+ }
}
void Train::halt_event(bool h)