import Keyboard from './keyboard';

class Input {
	private keyboard = new Keyboard();

	get up() {
		return (
			this.keyboard.isPressed('KeyW') || this.keyboard.isPressed('ArrowUp')
		);
	}

	get down() {
		return (
			this.keyboard.isPressed('KeyS') || this.keyboard.isPressed('ArrowDown')
		);
	}

	get left() {
		return (
			this.keyboard.isPressed('KeyA') || this.keyboard.isPressed('ArrowLeft')
		);
	}

	get right() {
		return (
			this.keyboard.isPressed('KeyD') || this.keyboard.isPressed('ArrowRight')
		);
	}

	get enter() {
		return this.keyboard.isPressed('Enter') || this.keyboard.isPressed('Space');
	}
}

export default Input;
