#include "StepTileCommand.h" #include "Canvas.h" using namespace std; StepTileCommand::StepTileCommand(Canvas & c, pair tile) : canvas(c) { this->x = tile.first; this->y = tile.second; } void StepTileCommand::execute() { Canvas & canvas = this->canvas; if (this->x >= canvas.data.columns) return; if (this->y >= canvas.data.rows) return; Tile & tile = canvas.get_tile(this->x, this->y); tile.behavior->step(nullptr); tile.update(); }