aboutsummaryrefslogtreecommitdiff
path: root/ToggleMuseumPauseCommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ToggleMuseumPauseCommand.cpp')
-rw-r--r--ToggleMuseumPauseCommand.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/ToggleMuseumPauseCommand.cpp b/ToggleMuseumPauseCommand.cpp
index bdd2ef6..82e2d30 100644
--- a/ToggleMuseumPauseCommand.cpp
+++ b/ToggleMuseumPauseCommand.cpp
@@ -1,17 +1,7 @@
#include "ToggleMuseumPauseCommand.h"
+#include "ControlBooleanCommand.h"
#include "Museum.h"
-ToggleMuseumPauseCommand::ToggleMuseumPauseCommand(Museum & m) : museum(m) {
- this->toggle = true;
-}
-
-ToggleMuseumPauseCommand::ToggleMuseumPauseCommand(Museum & m, bool set) : museum(m) {
- this->toggle = false;
- this->value = set;
-}
-
-void ToggleMuseumPauseCommand::execute() {
- if (this->toggle) this->value = !this->museum.get_pause();
- this->museum.set_pause(this->value);
-}
+ToggleMuseumPauseCommand::ToggleMuseumPauseCommand(Museum & m) : ControlBooleanCommand(m.paused) { }
+ToggleMuseumPauseCommand::ToggleMuseumPauseCommand(Museum & m, bool set) : ControlBooleanCommand(m.paused, set) { }