package se.urmo.game.input;

import se.urmo.game.main.GameStateManager;

import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

public class KeyHandler implements KeyListener {
    private final GameStateManager gameStateManager;

    public KeyHandler(GameStateManager gameStateManager) {
        this.gameStateManager = gameStateManager;
    }

    @Override
    public void keyTyped(KeyEvent e) {
        //not in use
    }

    @Override
    public void keyPressed(KeyEvent e) {
        gameStateManager.getCurrentState().keyPressed(e);
    }

    @Override
    public void keyReleased(KeyEvent e) {
        gameStateManager.getCurrentState().keyReleased(e);
    }
}
