using UnityEngine;
using System.Collections.Generic;

public class Controller : MonoBehaviour {
	public GameObject _regionTemplate;
	public static GameObject regionTemplate;
	public GameObject _mainCamera;
	public static GameObject mainCamera;

	public enum MapMode {Terrain, Culture}; 

	public static List<Biome> biomes = new List<Biome>();
	public static Biome sea;
	public static Biome ice;
	public static HashSet<Culture> cultures = new HashSet<Culture>();
	public static HashSet<Culture> newCultures = new HashSet<Culture>(); //Used during culture split

	// Use this for initialization
	void Start () {
		initNonStaticObjects();

		biomes.Add(new Biome("forest", 1000, 10, 50, 0.7f));
		biomes.Add(new Biome("mountains", 4000, 0, 30, 0.2f));
		biomes.Add(new Biome("sea", -100, 10, 80, 0));
		biomes.Add(new Biome("desert", 100, 40, 0, 0.2f));
		biomes.Add(new Biome("marsh", 0, 20, 100, 0.3f));
		biomes.Add(new Biome("plains", 0, 20, 40, 1.0f));
		biomes.Add(new Biome("ice", 0, -10, 30, 0));

		sea = biomes[2];
		ice = biomes[6];

		WorldGenerator.gen(25, 13);

		//Language.fromRaw("Assets/Languages/Raw/english.txt");//.saveMatrix("Assets/Languages/Matrices/english.txt");
		/*Language english = Language.fromMatrix("Assets/Languages/Matrices/english.txt");
		for (int i = 0; i < 1000; i++) {
			Debug.Log(english.genWord());
		}*/

		Language english = Language.fromRaw("Assets/Languages/Raw/english.txt");
		for (int i = 0; i < 1000; i++) {
			Debug.Log(english.genWord());
		}
	}

	void initNonStaticObjects() {
		regionTemplate = _regionTemplate;
		mainCamera = _mainCamera;
	}
	
	// Update is called once per frame
	void Update () {
		Vector3 camPos = mainCamera.transform.position;
		camPos.x += Input.GetAxis("Horizontal");
		camPos.y += Input.GetAxis("Vertical");
		mainCamera.transform.position = camPos;
	}
}
