using System.Collections.Generic;
using Sandbox.ModAPI.Ingame;

namespace IngameScript
{
    partial class Program
    {
        public enum GasTankAction
        {
            Stockpile,
            Dispense,
        }

        public class BlockActionGasTank : BlockAction
        {
            private IMyGasTank _gasTank;
            private GasTankAction _action;

            public BlockActionGasTank(
                IMyGasTank gasTank,
                GasTankAction action
            )
            {
                _gasTank = gasTank;
                _action = action;
            }

            protected override IEnumerator<bool> onRun()
            {
                switch (_action)
                {
                    case GasTankAction.Stockpile:
                        _gasTank.Stockpile = true;
                        break;
                    case GasTankAction.Dispense:
                        _gasTank.Stockpile = false;
                        break;
                }
                yield return true;
            }
        }
    }
}