using UnityEngine;
using System.Collections.Generic;

public class GameMgr : MonoBehaviour {

	FiniteStateMachine<GameMgr> 				m_Fsm;
	Dictionary<string, FSMState<GameMgr>> 		m_States;
	MenuMng menu;
	void Start () {
		menu = GetComponent<MenuMng>();
		m_States = new Dictionary<string, FSMState<GameMgr>>()
		{
			{ "main",  new MainState() }, 
		};

		m_Fsm = new FiniteStateMachine<GameMgr>();
		m_Fsm.configure(this, m_States["main"]);
	
	}

	public void toState(string stateName) {
		if(m_States.ContainsKey(stateName)){
			m_Fsm.changeState(m_States[stateName]);
		}
		else
			Debug.LogWarning("State name not valid");
	}


	class MainState : FSMState<GameMgr> 
	{
		public override void enter (GameMgr entity)
		{
			
		}

		public override void exit (GameMgr entity)
		{

		}
	}

	class PlayState : FSMState<GameMgr> 
	{
		public override void enter (GameMgr entity)
		{

		}

		public override void exit (GameMgr entity)
		{

		}
	}
}
