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

public class BattleChange : MonoBehaviour {


	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

    public BattleChange(int player, Battle battle) {
        List<Monster> monsters = GameMaster.players[player].GetMonsters();

        GameMaster.activePlayer = player;
        GameMaster.battle = battle;

        string buttonName = "";

        if (player == 0){
            buttonName = "demon0";
        } else {
            buttonName = "demon1";
        }

        int counter = 0;
        foreach (Monster monster in monsters) {

            Debug.Log("geht");
            counter++;
            bool isDead = monster.GetIsDead();

            if (isDead) {

                string path = "selectOverlay"+player;
                path = path + "/"+buttonName+counter;
                Debug.Log("Path:" + path);
                Debug.Log(GameObject.Find(path));
                GameObject.Find(path).GetComponent<Button>().interactable = false;
            }

        }
    }



}
