using UnityEngine;
using System.Collections;

public class GameAssets {
	private static GameAssets instance;

	private GameObject tileNormal;
	private GameObject tileBlocked;
	private GameObject tileRed;
	private GameObject tileGreen;
	private GameObject tileBlue;
	
	private GameObject unitLightRed;
	private GameObject unitLightGreen;
	private GameObject unitLightBlue;
	private GameObject unitLightLeader;
	
	private GameObject unitDarkRed;
	private GameObject unitDarkGreen;
	private GameObject unitDarkBlue;
	private GameObject unitDarkLeader;
	
	private GameObject fog;
	private GameObject highlight;
	private GameObject throne;

	
	public static GameAssets get() {
		if (instance == null) instance = new GameAssets();
		return instance;
	}

	private GameAssets() {
		tileNormal = (GameObject)Resources.Load("TileNormal", typeof(GameObject));
		tileBlocked = (GameObject)Resources.Load("TileBlocked", typeof(GameObject));
		tileRed = (GameObject)Resources.Load("TileRed", typeof(GameObject));
		tileGreen = (GameObject)Resources.Load("TileGreen", typeof(GameObject));
		tileBlue = (GameObject)Resources.Load("TileBlue", typeof(GameObject));
		
		unitLightRed = (GameObject)Resources.Load("UnitLightRed", typeof(GameObject));
		unitLightGreen = (GameObject)Resources.Load("UnitLightGreen", typeof(GameObject));
		unitLightBlue = (GameObject)Resources.Load("UnitLightBlue", typeof(GameObject));
		unitLightLeader = (GameObject)Resources.Load("UnitLightLeader", typeof(GameObject));
		
		unitDarkRed = (GameObject)Resources.Load("UnitDarkRed", typeof(GameObject));
		unitDarkGreen = (GameObject)Resources.Load("UnitDarkGreen", typeof(GameObject));
		unitDarkBlue = (GameObject)Resources.Load("UnitDarkBlue", typeof(GameObject));
		unitDarkLeader = (GameObject)Resources.Load("UnitDarkLeader", typeof(GameObject));
		
		fog = (GameObject)Resources.Load("Fog", typeof(GameObject));
		highlight = (GameObject)Resources.Load("Highlight", typeof(GameObject));
		throne = (GameObject)Resources.Load("Throne", typeof(GameObject));
	}
	
	public GameObject getTileNormal() {
		return tileNormal;
	}
	
	public GameObject getTileBlocked() {
		return tileBlocked;
	}
	
	public GameObject getTileRed() {
		return tileRed;
	}
	
	public GameObject getTileGreen() {
		return tileGreen;
	}
	
	public GameObject getTileBlue() {
		return tileBlue;
	}
	
	public GameObject getUnitRed(Player.Side side) {
		if (side == Player.Side.LIGHT) return unitLightRed;
		return unitDarkRed;
	}
	
	public GameObject getUnitGreen(Player.Side side) {
		if (side == Player.Side.LIGHT) return unitLightGreen;
		return unitDarkGreen;
	}
	
	public GameObject getUnitBlue(Player.Side side) {
		if (side == Player.Side.LIGHT) return unitLightBlue;
		return unitDarkBlue;
	}
	
	public GameObject getUnitLeader(Player.Side side) {
		if (side == Player.Side.LIGHT) return unitLightLeader;
		return unitDarkLeader;
	}
	
	public GameObject getFog() {
		return fog;
	}
	
	public GameObject getHighlight() {
		return highlight;
	}
	
	public GameObject getThrone() {
		return throne;
	}
}
