Add Landing Gear to available sequencer actions.
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)BlockActionConnector.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)BlockActionDoor.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)BlockActionGasTank.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)BlockActionLandingGear.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)BlockActionMerge.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)BlockActionPiston.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)BlockActionRotor.cs" />
|
||||
|
50
Mixins/ActionGroups/BlockActionLandingGear.cs
Normal file
50
Mixins/ActionGroups/BlockActionLandingGear.cs
Normal file
@ -0,0 +1,50 @@
|
||||
using System.Collections.Generic;
|
||||
using Sandbox.ModAPI.Ingame;
|
||||
|
||||
namespace IngameScript
|
||||
{
|
||||
partial class Program
|
||||
{
|
||||
public enum LandingGearAction
|
||||
{
|
||||
Unlock,
|
||||
Lock,
|
||||
Disable,
|
||||
Enable,
|
||||
}
|
||||
|
||||
public class BlockActionLandingGear : BlockAction
|
||||
{
|
||||
private IMyLandingGear _gear;
|
||||
private LandingGearAction _action;
|
||||
|
||||
public BlockActionLandingGear(
|
||||
IMyLandingGear gear,
|
||||
LandingGearAction action
|
||||
)
|
||||
{
|
||||
_gear = gear;
|
||||
_action = action;
|
||||
}
|
||||
|
||||
protected override IEnumerator<bool> onRun()
|
||||
{
|
||||
switch (_action)
|
||||
{
|
||||
case LandingGearAction.Enable:
|
||||
_gear.Enabled = true;
|
||||
yield break;
|
||||
case LandingGearAction.Disable:
|
||||
_gear.Enabled = false;
|
||||
yield break;
|
||||
case LandingGearAction.Lock:
|
||||
// STUB
|
||||
break;
|
||||
case LandingGearAction.Unlock:
|
||||
// STUB
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user