Add Landing Gear to available sequencer actions.

This commit is contained in:
2025-02-28 12:47:11 -08:00
parent 484e227f93
commit f2f4ec5395
3 changed files with 73 additions and 0 deletions

View File

@ -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" />

View 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;
}
}
}
}
}