using UnityEngine;
using System.Collections;

public enum MovementKeys { CameraSwitch, Up, Down, Left, Right, Pause };

public class InputWrapper : MonoBehaviour {

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

	public static bool GetKeyDown(MovementKeys CurKey){
		switch (CurKey) {
		case MovementKeys.CameraSwitch: return Input.GetKeyDown(KeyCode.Return);
		case MovementKeys.Pause: return Input.GetKeyDown(KeyCode.Escape);
		case MovementKeys.Up: 
			if(Input.GetAxis("Vertical") == 1)
				return true;
			else 
				return false;
		case MovementKeys.Down :
			if(Input.GetAxis("Vertical") == -1)
				return true;
			else 
				return false;
		case MovementKeys.Left: 
			if(Input.GetAxis("Horizontal") == -1)
				return true;
			else
				return false;
		case MovementKeys.Right:
			if(Input.GetAxis("Horizontal") == 1)
				return true;
			else
				return false;
		}

		return false;
	}

	public static bool GetKeyUp(MovementKeys CurKey){
		switch (CurKey) {
		case MovementKeys.CameraSwitch: return Input.GetKeyUp(KeyCode.Return);
		case MovementKeys.Pause: return Input.GetKeyUp (KeyCode.Escape);
		case MovementKeys.Up: 
			if(Input.GetAxis("Vertical") != 1)
				return true;
			else 
				return false;
		case MovementKeys.Down :
			if(Input.GetAxis("Vertical") != -1)
				return true;
			else 
				return false;
		case MovementKeys.Left: 
			if(Input.GetAxis("Horizontal") != -1)
				return true;
			else
				return false;
		case MovementKeys.Right:
			if(Input.GetAxis("Horizontal") != 1)
				return true;
			else
				return false;
		}
		
		return false;
	}

	public static bool GetKey(MovementKeys CurKey){

		switch (CurKey) {
		case MovementKeys.CameraSwitch: return Input.GetKey(KeyCode.Return);
		case MovementKeys.Pause: return Input.GetKey( KeyCode.Escape);
		case MovementKeys.Up: 
			if(Input.GetAxis("Vertical") == 1)
				return true;
			else 
				return false;
		case MovementKeys.Down :
			if(Input.GetAxis("Vertical") == -1)
				return true;
			else 
				return false;
		case MovementKeys.Left: 
			if(Input.GetAxis("Horizontal") == -1)
				return true;
			else
				return false;
		case MovementKeys.Right:
			if(Input.GetAxis("Horizontal") == 1)
				return true;
			else
				return false;
		}
		
		return false;
	}


}
