using UnityEngine;
using System.Collections;

public class Dictionaries : MonoBehaviour {

	public static Dictionaries dictionaries;

    public char[] symbolKeyCodes = { '0', '1', '2', '3',
                                     '4', '5', '6', '7',
                                     '8', '9', 'A', 'B',
                                     'C', 'D', 'E', 'F'};
	[System.Serializable]
	
	public class Glossary
	{
		public string[] greetingsOK;
		public string[] greetingsKO;		
	}

	public Glossary[] encyclopedia;

	[System.Serializable]

	public class ShieldCodes
	{
		public string[] masterCodes;
		public string[] type0Codes;
		public string[] type1Codes;
		public string[] type2Codes;
		public string[] type3Codes;
		public string[] type4Codes;
		public string[] type5Codes;
	}
	
	public ShieldCodes shieldcodes;
	public string shieldCode = "";


	public GameObject[] symbolKeys;

	public GameObject activeProgram;


	public char currentDictionary;
	public ArrayList currentDisplaySymbols;
	public string currentMessage;
	public string messageToSend;

	public bool bulletExists = false;

	public Texture2D cursorTexture;
	private CursorMode cursorMode = CursorMode.Auto;
	private Vector2 hotSpot = Vector2.zero;

	public int score = 0;
	public bool startGame = false;
	public bool gameOver = false;
	public int killedGoodPrograms = 0;

	void Awake () { //This makes control an inmortal object
		
		if (dictionaries == null)
		{
//			DontDestroyOnLoad(gameObject);
			dictionaries = this;
		}
		else if (dictionaries != this)
		{
			Destroy(gameObject);
		}
		
	}


	// Use this for initialization
	void Start () {
		symbolKeys = GameObject.FindGameObjectsWithTag("symbolKey");
        currentDisplaySymbols = new ArrayList();

		Cursor.SetCursor(cursorTexture, hotSpot, cursorMode);

		score = 0;

	}
	
	// Update is called once per frame
	void Update () {

		if (killedGoodPrograms > 2)
		{
			gameOver = true;
		}

	
	}


}
