aboutsummaryrefslogtreecommitdiff
path: root/StepTileCommand.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-18 15:48:14 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-18 15:48:14 +0200
commitd8289105193707daede1a5b59137f18e20f20aeb (patch)
tree939908b9c4c6f7aaef8aa61ee2e04be3e85610b6 /StepTileCommand.cpp
parent76e61d68bbf568ec0d7fc4632e52d4de5496b003 (diff)
(2/2) rename
Diffstat (limited to 'StepTileCommand.cpp')
-rw-r--r--StepTileCommand.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/StepTileCommand.cpp b/StepTileCommand.cpp
new file mode 100644
index 0000000..ff5c6b2
--- /dev/null
+++ b/StepTileCommand.cpp
@@ -0,0 +1,12 @@
+#include "StepTileCommand.h"
+#include "Museum.h"
+
+void StepTileCommand::execute(unsigned int x, unsigned int y) {
+ Museum & museum = this->get_museum();
+ if (x >= museum.canvas.data.columns) return;
+ if (y >= museum.canvas.data.rows) return;
+ Tile & tile = museum.canvas.get_tile(x, y);
+ tile.step(nullptr);
+ tile.update();
+}
+