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