diff --git a/src/Devices/AtcBombardier.cs b/src/Devices/AtcBombardier.cs index 6bf3766..f988743 100644 --- a/src/Devices/AtcBombardier.cs +++ b/src/Devices/AtcBombardier.cs @@ -45,6 +45,18 @@ namespace OpenbveFcmbTrainPlugin /// The current state of the ATC control. private AtcControlStates AtcControlState; + /// Represents the state of the track. + private enum TrackStates + { + Unprotected, + Enable, + ATC, + Disable + } + + /// The current state of the track. + private TrackStates TrackState; + /// The time needed by the ATC device to initialize, in seconds. private double InitializationTime; @@ -360,11 +372,30 @@ namespace OpenbveFcmbTrainPlugin } } + /// Is called to inform about signals. + /// The signal data. + internal override void SetSignal(SignalData[] signal) + { + + } + /// Is called when a beacon is passed. /// The beacon data. internal override void SetBeacon(BeaconData beacon) { - + int type = beacon.Type; + switch (type) + { + case -16777215: + { + if (!(beacon.Optional >= 0 & beacon.Optional <= 3)) + { + break; + } + TrackState = (TrackStates)beacon.Optional; + return; + } + } } /// Is called when the device should perform the AI.