using OpenBveApi.Runtime;
namespace OpenbveFcmbTrainPlugin
{
/// Represents an abstract device.
internal abstract class Device
{
/// The power notch requested by the device.
internal int RequestedPowerNotch = -1;
/// The brake notch requested by the device.
internal int RequestedBrakeNotch = -1;
/// The door interlock requested by the device.
internal DoorInterlockStates RequestedDoorInterlock;
/// Is called when the device state should be updated.
/// The current train.
/// The current route.
/// Whether the device should initialize.
/// The time elapsed since the previous call.
internal virtual void Update(Train train, Route route, bool init, Time elapsedTime) { }
/// Is called when the driver changes the reverser.
/// The new reverser position.
internal virtual void SetReverser(int reverser) { }
/// Is called when the driver changes the power notch.
/// The new power notch.
internal virtual void SetPower(int powerNotch) { }
/// Is called when the driver changes the brake notch.
/// The new brake notch.
internal virtual void SetBrake(int brakeNotch) { }
/// Is called when the state of a key changes.
/// The key.
/// Whether the key is pressed or released.
/// The current train.
internal virtual void KeyChange(VirtualKeys key, bool pressed, Train train) { }
/// Is called when the state of the doors changes.
/// The old state of the doors.
/// The new state of the doors.
internal virtual void DoorChange(DoorStates oldState, DoorStates newState) { }
/// Is called when a horn is played or when the music horn is stopped.
/// The type of horn.
internal virtual void HornBlow(HornTypes type) { }
/// Is called to inform about signals.
/// The signal data.
internal virtual void SetSignal(SignalData[] signal) { }
/// Is called when a beacon is passed.
/// The beacon data.
internal virtual void SetBeacon(BeaconData beacon) { }
/// Is called when the plugin should perform the AI.
/// The AI data.
/// The current train.
/// The current route.
internal virtual void PerformAI(AIData data, Train train, Route route) { }
}
}