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

public static class GameBrain {
	public static List<BonusScript> health = new List<BonusScript>();
	public static List<BonusScript> armor = new List<BonusScript>();
	public static List<BonusScript> ammo = new List<BonusScript>();
	
	public static List<UnitStatus> units = new List<UnitStatus>();
	public static int unitCount;
	
	public static int lastUnitID=0;
	
	public static string[] names = {"MoKa","SYPIAC","SarCasm","Randomize","DRON","Sharky","Dj_smart","tiger1025","beisik","Mefistofel","KEFIR","LetsOffBrains","SlavyanOOs","Snogg","Darthman","AleD","BlooV","CoreX","ABTOMAT","Jimon.","PAX","NOTCH","Sokrat","Adolf","Unity","Error 404"};
	
	public static void Clear()
	{
		bool killed = false;
		foreach(UnitStatus a in units)
		{
			if(a.transform.GetComponent<AIscript>())
			{
				a.gameObject.active = false;
			} 
			else {
				a.gameObject.active = false;
			}
			killed=true;
		}
		
		if(killed)
		{
			health.Clear();
			armor.Clear();
			ammo.Clear();
			units.Clear();
			lastUnitID=0;
			unitCount=0;
		}
	}
	
	public static void Info()
	{	
		Debug.Log("health: "+health.Count+"armor: "+armor.Count+"ammo: "+ammo.Count+"units: "+units.Count);	
	}
}
