| 1 |
#ifndef HEADER_STATEINPUT_H |
| 2 |
#define HEADER_STATEINPUT_H |
| 3 |
|
| 4 |
class Keymap; |
| 5 |
class GameState; |
| 6 |
|
| 7 |
#include "InputHandler.h" |
| 8 |
|
| 9 |
/** |
| 10 |
* Handle input for game state. |
| 11 |
*/ |
| 12 |
class StateInput : public InputHandler { |
| 13 |
protected: |
| 14 |
static const int KEY_QUIT = 1; |
| 15 |
static const int KEY_CONSOLE = 2; |
| 16 |
static const int KEY_HELP = 3; |
| 17 |
static const int KEY_MENU = 4; |
| 18 |
static const int KEY_SUBTITLES = 5; |
| 19 |
Keymap *m_keymap; |
| 20 |
GameState *m_state; |
| 21 |
protected: |
| 22 |
virtual void quitState(); |
| 23 |
virtual void enableConsole(); |
| 24 |
virtual void enableHelp() {}; |
| 25 |
virtual void enableMenu() {}; |
| 26 |
virtual void enableSubtitles(); |
| 27 |
virtual void specStroke(const KeyStroke &/*stroke*/) {} |
| 28 |
virtual void specKey(int keyIndex); |
| 29 |
void toggleParam(const std::string ¶m); |
| 30 |
public: |
| 31 |
StateInput(GameState *state); |
| 32 |
~StateInput(); |
| 33 |
|
| 34 |
virtual void keyEvent(const KeyStroke &stroke); |
| 35 |
}; |
| 36 |
|
| 37 |
#endif |