using System; using OpenBveApi.Runtime; namespace OpenbveFcmbPlugin { /// The interface to be implemented by the plugin. public partial class OpenbveFcmbPlugin : IRuntime { /// Holds the aspect last reported to the plugin in the SetSignal call. int LastAspect = -1; /// Holds the array of panel variables. /// Be sure to initialize in the Load call. public static int[] Panel; /// Remembers which of the virtual keys are currently pressed down. public static bool[] KeysPressed = new bool[34]; /// Whether the plugin is initializing or reinitializing. public static bool Initializing; /// Is called when the plugin is loaded. /// The properties supplied to the plugin on loading. /// Whether the plugin was loaded successfully. public bool Load(LoadProperties properties) { return true; } /// Is called when the plugin is unloaded. public void Unload() { } /// Is called after loading to inform the plugin about the specifications of the train. /// The specifications of the train. public void SetVehicleSpecs(VehicleSpecs specs) { } /// Is called when the plugin should initialize or reinitialize. /// The mode of initialization. public void Initialize(InitializationModes mode) { } /// Is called every frame. /// The data passed to the plugin. public void Elapse(ElapseData data) { } /// Is called when the driver changes the reverser. /// The new reverser position. public void SetReverser(int reverser) { } /// Is called when the driver changes the power notch. /// The new power notch. public void SetPower(int powerNotch) { } /// Is called when the driver changes the brake notch. /// The new brake notch. public void SetBrake(int brakeNotch) { } /// Is called when a virtual key is pressed. /// The virtual key that was pressed. public void KeyDown(VirtualKeys key) { } /// Is called when a virtual key is released. /// The virtual key that was released. public void KeyUp(VirtualKeys key) { } /// Is called when a horn is played or when the music horn is stopped. /// The type of horn. public void HornBlow(HornTypes type) { } /// Is called when the state of the doors changes. /// The old state of the doors. /// The new state of the doors. public void DoorChange(DoorStates oldState, DoorStates newState) { } /// Is called when the aspect in the current or in any of the upcoming sections changes, or when passing section boundaries. /// The signal array is guaranteed to have at least one element. When accessing elements other than index 0, you must check the bounds of the array first. public void SetSignal(SignalData[] signal) { int aspect = signal[0].Aspect; if (aspect != LastAspect) { } } /// Is called when the train passes a beacon. /// The beacon data. public void SetBeacon(BeaconData beacon) { } /// Is called when the plugin should perform the AI. /// The AI data. public void PerformAI(AIData data) { } } }