#ifndef _KEYBOARD_CONTROLLER_H #define _KEYBOARD_CONTROLLER_H #include "Controller.h" #include "types.h" // Compatible with glut values typedef enum { KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT } KeyCode; class MainWindow; /** * A class that links keybard inputs and player moves **/ class KeyboardController : public Controller { typedef enum { NO_MOVE, MOVE_LEFT, MOVE_RIGHT } NextMove; public: KeyboardController(Player* pPlayer, uint leftKey, uint rightKey); virtual ~KeyboardController(void); public: /** * Is called when a key is pressed **/ void PressKey(KeyCode key); /** * Is called when a decision is required **/ void think(); /** * Resets the controller (does nothing here) **/ void reset(); private: const uint m_leftKey; const uint m_rightKey; NextMove m_nextMove; }; #endif