using System;
using System.Collections.Generic;
using UnityEngine;
using Utils;

namespace Game
{
	[CreateAssetMenu(menuName = "Game Screens/Variable Game Screen")]
	public class VariableScreenAsset : GameScreenAsset
	{
		[Serializable]
		public class GameScreenVariation
		{
			public string text;
			public GameScreenAsset gameScreen;
		}

		[SerializeField] private List<GameScreenVariation> variations;

		public override string TextInfo
		{
			get { return variations[Mathf.Min(VisitsCount, variations.Count - 1)].text; }
		}

		public override GameScreenAsset NextScreen
		{
			get
			{
				return variations[Mathf.Min(VisitsCount, variations.Count - 1)].gameScreen;
			}
		}

		public override bool HideNextScreenInspector
		{
			get { return true; }
		}

		public override bool UseTextInfo
		{
			get { return true; }
		}

		public override bool UseInteractiveModule
		{
			get { return false; }
		}

		public override bool HideTextInfoInspector
		{
			get { return true; }
		}

		public override bool HideInteractiveModuleInspector
		{
			get { return true; }
		}

		public override bool HideTextChoiceInspector
		{
			get { return true; }
		}

		public override void OnEnable()
		{
			base.OnEnable();
			
			variations.Shuffle();
		}
	}
}