Initial commit
commit
8b682dc302
|
@ -0,0 +1,120 @@
|
||||||
|
using System;
|
||||||
|
using OpenBveApi.Runtime;
|
||||||
|
|
||||||
|
namespace OpenbveFcmbPlugin
|
||||||
|
{
|
||||||
|
/// <summary>The interface to be implemented by the plugin.</summary>
|
||||||
|
public partial class OpenbveFcmbPlugin : 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)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{9197FFA4-D95A-410C-A705-4E7CD187546A}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<RootNamespace>OpenBveFcmbPlugin</RootNamespace>
|
||||||
|
<AssemblyName>OpenBveFcmbPlugin</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<ConsolePause>false</ConsolePause>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release</OutputPath>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<ConsolePause>false</ConsolePause>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="OpenBveApi">
|
||||||
|
<HintPath>..\..\..\..\lib\openbve\OpenBveApi.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="OpenBveFcmbPlugin.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
|
@ -0,0 +1,17 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 15
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenBveFcmbTrainPlugin", "OpenBveFcmbTrainPlugin.csproj", "{9197FFA4-D95A-410C-A705-4E7CD187546A}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{9197FFA4-D95A-410C-A705-4E7CD187546A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{9197FFA4-D95A-410C-A705-4E7CD187546A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{9197FFA4-D95A-410C-A705-4E7CD187546A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{9197FFA4-D95A-410C-A705-4E7CD187546A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
|
@ -0,0 +1,26 @@
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
|
// Information about this assembly is defined by the following attributes.
|
||||||
|
// Change them to the values specific to your project.
|
||||||
|
|
||||||
|
[assembly: AssemblyTitle("OpenBVE FCMB Train Plugin")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("")]
|
||||||
|
[assembly: AssemblyCopyright("${AuthorCopyright}")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||||
|
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||||
|
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||||
|
|
||||||
|
[assembly: AssemblyVersion("1.0.*")]
|
||||||
|
|
||||||
|
// The following attributes are used to specify the signing key for the assembly,
|
||||||
|
// if desired. See the Mono documentation for more information about signing.
|
||||||
|
|
||||||
|
//[assembly: AssemblyDelaySign(false)]
|
||||||
|
//[assembly: AssemblyKeyFile("")]
|
Loading…
Reference in New Issue