aboutsummaryrefslogtreecommitdiff
path: root/TimeTravelCommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TimeTravelCommand.cpp')
-rw-r--r--TimeTravelCommand.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/TimeTravelCommand.cpp b/TimeTravelCommand.cpp
index 34468c0..44320c9 100644
--- a/TimeTravelCommand.cpp
+++ b/TimeTravelCommand.cpp
@@ -1,11 +1,14 @@
#include "TimeTravelCommand.h"
#include "Museum.h"
-void TimeTravelCommand::forwards() {
- this->get_museum().skip_forward();
+TimeTravelCommand::TimeTravelCommand(Museum & m, bool forwards) : museum(m) {
+ this->forwards = forwards;
}
-void TimeTravelCommand::backwards() {
- this->get_museum().skip_backward();
+void TimeTravelCommand::execute() {
+ if (this->forwards)
+ this->museum.skip_forward();
+ else
+ this->museum.skip_backward();
}