package rendercalculator.player;

import java.awt.Graphics2D;

import animations.PlayerAnimations;
import interfaces.ItemIDs;
import interfaces.PlayerAnimationIDs;
import player.Player;

/**  ------------- Nihilne ------------
    *** @author Mitch Weaver - 2016 ***
      ~~~~ All Rights Reserved ~~~~ */

public final class HandSlotRenderer implements ItemIDs, PlayerAnimationIDs {
	
	public final static void render(final Graphics2D g2d){
		switch(Player.currentAnimation){
			case IDLE: idle(g2d); break;
			case WALK: walk(g2d); break;
			case AXE_CHOP: axeChop(g2d); break;
			case MINE_ROCK: mine(g2d);
			case GET_HIT: getHit(g2d);
		}
	}
	
	private final static void idle(final Graphics2D g2d){
		switch(Player.equipmentSlots[HAND_SLOT].itemId){
			case CRUDE_AXE: PlayerAnimations.crudeAxe.renderIdle(g2d); break;
			case CRUDE_PICKAXE: PlayerAnimations.crudePickaxe.renderIdle(g2d); break;
			case TORCH: PlayerAnimations.torch.renderIdle(g2d); break;
			case GOBLIN_SPEAR: PlayerAnimations.goblinSpear.renderIdle(g2d); break;
		}
	}

	private final static void walk(final Graphics2D g2d){
		switch(Player.equipmentSlots[HAND_SLOT].itemId){
			case CRUDE_AXE: PlayerAnimations.crudeAxe.renderWalk(g2d); break;
			case CRUDE_PICKAXE: PlayerAnimations.crudePickaxe.renderWalk(g2d); break;
			case TORCH: PlayerAnimations.torch.renderWalk(g2d); break;
			case GOBLIN_SPEAR: PlayerAnimations.goblinSpear.renderWalk(g2d);
		}
	}
	
	private static final void getHit(final Graphics2D g2d) {
		switch(Player.equipmentSlots[HAND_SLOT].itemId) {
			case CRUDE_AXE: PlayerAnimations.crudeAxe.renderGetHit(g2d); break;
			case CRUDE_PICKAXE: PlayerAnimations.crudePickaxe.renderGetHit(g2d); break;
			case TORCH: PlayerAnimations.torch.renderGetHit(g2d); break;
			case GOBLIN_SPEAR: PlayerAnimations.goblinSpear.renderGetHit(g2d); break;
		}
	}
	
	private final static void axeChop(final Graphics2D g2d){
		switch(Player.equipmentSlots[HAND_SLOT].itemId){
			case CRUDE_AXE: PlayerAnimations.crudeAxe.renderChop(g2d); break;
		}
	}
	
	private final static void mine(final Graphics2D g2d){
		switch(Player.equipmentSlots[HAND_SLOT].itemId){
			case CRUDE_PICKAXE: PlayerAnimations.crudePickaxe.renderMine(g2d); break;
		}
	}
}