summaryrefslogtreecommitdiff
path: root/src/command.cpp
blob: d0ee45b50ce78c77b8f9bae68ff2236d1988ab3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "command.h"
#include "game.h"

Command::~Command(){}

Nop::~Nop(){}
void Nop::execute( GameState &game ){
}

// Window commands
WindowClose::~WindowClose(){}
void WindowClose::execute( GameState &game ){
    game.close();
}

WindowFocus::~WindowFocus(){}
void WindowFocus::execute( GameState &game ){
    game.resume();
}

WindowUnFocus::~WindowUnFocus(){}
void WindowUnFocus::execute( GameState &game ){
    game.pause();
}

// Keyboard commands
KeyboardDownReleased::~KeyboardDownReleased(){}
void KeyboardDownReleased::execute( GameState &game ){
    game.releaseDown();
}
KeyboardDownPressed::~KeyboardDownPressed(){}
void KeyboardDownPressed::execute( GameState &game ){
    game.pressDown();
}