using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System;

namespace GGJ16
{
    public class TurnService : MonoBehaviour
    {
        public int currentPlayerTurn;
        //Instance of PlayerService
        public static TurnService instance;

        void Awake()
        {
            if (instance != null)
            {
                Debug.LogError("Singleton violation");
                return;
            }

            instance = this;
        }

        void Start()
        {
            currentPlayerTurn = 1;
        }

        public void NextTurn()
        {
            CheckForLosers();
            if(currentPlayerTurn != 3)
            {
                //if player is still in the game, if player.isAlive() == true
                currentPlayerTurn++;
            }
            else
            {
                currentPlayerTurn = 1;
            }
            //Next Turn PlayerService
        }

        private void CheckForLosers()
        {
            for(int i = 1; i < 4; i++)
            {
                //if() if player i lost then destroy his temple and display message that he lost and then change his status to loser
            }
        }
    }
}
