using System;

public class BunkerStationLaunch : BunkerStation
{
	private StationLaunchMode _launchMode = StationLaunchMode.POSITION;

	private Action<StationLaunchMode> _launchButtonPressedEvent;
	public event Action<StationLaunchMode> LaunchButtonPressedEvent
	{
		add
		{
			_launchButtonPressedEvent -= value;
			_launchButtonPressedEvent += value;
		}
		remove
		{
			_launchButtonPressedEvent -= value;
		}
	}

	public override void Press()
	{
		base.Press();

		UnityEngine.Debug.Log("Press called ! with launchMode: " + _launchMode);
		_launchButtonPressedEvent?.Invoke(_launchMode);

		// Next Launch Mode
		switch (_launchMode)
		{
			// With rotations
			// case StationLaunchMode.POSITION:
			// 	SetRotationMode();
			// 	break;
			// case StationLaunchMode.ROTATION:
			// 	SetLaunchMode();
			// 	break;
			// case StationLaunchMode.LAUNCH:
			// 	SetPositionMode();
			// 	break;

			// Without rotation
			case StationLaunchMode.POSITION:
				SetLaunchMode();
				break;
			case StationLaunchMode.LAUNCH:
				SetPositionMode();
				break;
		}
	}

	public void SetPositionMode()
	{
		_launchMode = StationLaunchMode.POSITION;
	}

	public void SetRotationMode()
	{
		_launchMode = StationLaunchMode.ROTATION;
	}

	public void SetLaunchMode()
	{
		_launchMode = StationLaunchMode.LAUNCH;
	}
}
