package ei.game.input;

import org.lwjgl.input.Keyboard;

import ei.engine.LWJGLGameWindow;
import ei.engine.input.KeyboardInput;
import ei.engine.state.GameStateManager;

public class InGameKeyboardInput extends KeyboardInput{

	public InGameKeyboardInput() {
		super("InGameKeyboardInput");
	}

	@Override
	public void keyDown(int keycode) {
		if (Keyboard.KEY_ESCAPE == keycode) {
			if(GameStateManager.getInstance().getState("MenuState") != null){
				GameStateManager.getInstance().setDeActive("InGameState");
				GameStateManager.getInstance().setActive("MenuState");
			}
			else{
				LWJGLGameWindow.exit();
			}
		}
	}

	@Override
	public void keyUp(int keycode) {}

}
