aboutsummaryrefslogtreecommitdiff
path: root/ViewController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ViewController.cpp')
-rw-r--r--ViewController.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/ViewController.cpp b/ViewController.cpp
index a37c49a..d64ec35 100644
--- a/ViewController.cpp
+++ b/ViewController.cpp
@@ -11,11 +11,9 @@
#include "Museum.h"
ViewController::ViewController(Museum & m, View & v) : museum(m), view(v) {
- this->cmd_base = new Command(this->museum, this->view, *this);
}
ViewController::~ViewController() {
- delete this->cmd_base;
}
void ViewController::update() {
@@ -71,27 +69,27 @@ void ViewController::ev_keydown(KeyboardCode key) {
try {
switch (key) {
case KEY_SPACE: {
- ToggleMuseumPauseCommand(this->cmd_base).toggle();
+ ToggleMuseumPauseCommand(this->museum).execute();
break;
}
case KEY_ENTER: {
- StepTileCommand(this->cmd_base).execute(get<0>(this->mouse_pos), get<1>(this->mouse_pos));
+ StepTileCommand(this->museum.canvas, this->mouse_pos).execute();
break;
}
case KEY_O: {
- OpenFileGUICommand(this->cmd_base).execute();
+ OpenFileGUICommand(this->museum, this->view).execute();
break;
}
case KEY_A: {
- ToggleArtistVisibilityCommand(this->cmd_base).toggle();
+ ToggleArtistVisibilityCommand(*this).execute();
break;
}
case KEY_LEFT: {
- TimeTravelCommand(this->cmd_base).backwards();
+ TimeTravelCommand(this->museum, false).execute();
break;
}
case KEY_RIGHT: {
- TimeTravelCommand(this->cmd_base).forwards();
+ TimeTravelCommand(this->museum, true).execute();
break;
}
default: break;