diff options
Diffstat (limited to 'StepTileBehavior.cpp')
-rw-r--r-- | StepTileBehavior.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/StepTileBehavior.cpp b/StepTileBehavior.cpp new file mode 100644 index 0000000..2023bb8 --- /dev/null +++ b/StepTileBehavior.cpp @@ -0,0 +1,21 @@ +#include <memory> + +#include "StepTileBehavior.h" +#include "DeleteArtistTileBehavior.h" +#include "Tile.h" + +using namespace std; + +StepTileBehavior StepTileBehavior::instance { StepTileBehavior::type }; + +void StepTileBehavior::update(Tile & tile) { + if (this->interactions < 3) return; + tile.set_type(DeleteArtistTileBehavior::type); +} + +unique_ptr<TileBehavior> StepTileBehavior::clone(Museum & museum) { + auto instance = new StepTileBehavior(); + instance->museum = &museum; + return unique_ptr<TileBehavior>(instance); +} + |