package projectzombie.input.types;

import gl_engine.MathHelpers;
import gl_engine.vec.Vec2d;
import projectzombie.Main;
import projectzombie.inventory.Crafting;
import projectzombie.inventory.Inventory;
import projectzombie.menu.MenuGamePause;
import projectzombie.menu.MenuInventory;
import projectzombie.menu.MenuInventoryBasic;
import projectzombie.menu.MenuInventoryStorage;
import projectzombie.menu.gui.GUIItemSlotGetter;
import projectzombie.util.ItemStack;
import projectzombie.world.chunk.ChunkEventHandler;

public class InputGame implements Input
{

	@Override
	public void move(boolean state, double angle)
	{
		if(state)
		{
			// Move the player in the left sticks angle
			if(ChunkEventHandler.loaded) {
				Main.player.moveTowards(angle + Main.player.angle);
			}
			
			// Set the players moving to true
			Main.player.moving = true;
		}
		
		else {
			Main.player.moving = false;
		}
	}

	@Override
	public void fire(boolean state) {
		Main.player.leftClick();
	}

	@Override
	public void camera(boolean state, double amount) {
		Main.player.angle -= amount;
	}

	@Override
	public void itemAction(boolean state) {
		Main.player.rightClick();
	}

	@Override
	public void itemDrop(boolean state) {
		Main.player.dropItem();
	}

	@Override
	public void pause(boolean state) {
		Main.menu = new MenuGamePause();
		Main.game_paused = true;
	}

	@Override
	public void hotbarGoto(boolean state, int pos) {
		Main.player.inventory_hand = pos;
	}

	@Override
	public void hotbarShift(boolean state, int amount) {
		Main.player.inventory_hand += amount;
		Main.player.inventory_hand = MathHelpers.mod(Main.player.inventory_hand, 10);
	}
	
	@Override
	public void back(boolean state) {
	}
	
	@Override
	public void activate(boolean state) {
	}
	
	@Override
	public void openInventory() {
		Main.menu = new MenuInventoryBasic(Main.menu, Crafting.BASIC);
	}
	
	@Override
	public void type(char character) {
	}
	
	@Override
	public void key(int key) {
	}
	
	@Override
	public void keyCtrl(int key) {
	}

}
