package u;

import com.ld50.game.HF;

public class Uinput {
	// set defaults
	private static int left = 29;
	private static int right = 32;
	private static int up = 51;
	private static int down = 47;
	private static int fire = 0;
	private static int jump = 62;
	private static int inventory = 37;
	private static int crouch = 59;
	private static int sprint = 129;

	public Uinput() {

	}

	public static void LoadDefaultInputs() {
		boolean first = HF.GameSettings.getBoolean("IsFirstTimeRunningGame");// this is going to be backwards because it defaults to false.
		// System.out.println("first: " + first);
		if (!first) {// if the first time the game is running, set all the defaults
			HF.GameSettings.putBoolean("IsFirstTimeRunningGame", true);// remember this has to be backwards to work.^^
			HF.GameSettings.putInteger("left_key", 29);// a = 29
			HF.GameSettings.putInteger("right_key", 32);// d = 32
			HF.GameSettings.putInteger("up_key", 51);// w = 51
			HF.GameSettings.putInteger("down_key", 47);// s = 47
			HF.GameSettings.putInteger("fire_key", 0);// left_mouse_button = 0
			HF.GameSettings.putInteger("jump_key", 62);// space = 62
			HF.GameSettings.putInteger("inventory_key", 37);// i = 37
			HF.GameSettings.putInteger("crouch_key", 59);// = left_shift = 59
			HF.GameSettings.putInteger("sprint_key", 129);// = left_control = 129
			HF.GameSettings.flush();
		} else {// if not, load the defaults?... uhhhh
			left = HF.GameSettings.getInteger("left_key");
			right = HF.GameSettings.getInteger("right_key");// d = 32
			up = HF.GameSettings.getInteger("up_key");// w = 51
			down = HF.GameSettings.getInteger("down_key");// s = 47
			fire = HF.GameSettings.getInteger("fire_key");// left_mouse_button = 0
			jump = HF.GameSettings.getInteger("jump_key");// space = 62
			inventory = HF.GameSettings.getInteger("inventory_key");// i = 37
			crouch = HF.GameSettings.getInteger("crouch_key");// = left_shift = 59
			sprint = HF.GameSettings.getInteger("sprint_key");// = left_control = 129
		}

	}

	public static int Left() {
		return left;
	}

	public static int Right() {
		return right;
	}

	public static int Up() {
		return up;
	}

	public static int Down() {
		return down;
	}

	public static int Fire() {
		return fire;
	}

	public static int Jump() {
		return jump;
	}

	public static int Inventory() {
		return inventory;
	}

	public static int Crouch() {
		return crouch;
	}

	public static int Sprint() {
		return sprint;
	}

}
