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