#include #include "DeleteArtistTileBehavior.h" #include "SetNeighborTileBehavior.h" #include "Tile.h" #include "Museum.h" using namespace std; DeleteArtistTileBehavior DeleteArtistTileBehavior::instance { DeleteArtistTileBehavior::type }; void DeleteArtistTileBehavior::step(Artist * artist) { this->interactions++; if (artist != nullptr) this->museum->people.remove_artist(*artist); } void DeleteArtistTileBehavior::update(Tile & tile) { if (this->interactions == 0) return; tile.set_type(SetNeighborTileBehavior::type); } unique_ptr DeleteArtistTileBehavior::clone(Museum & museum) { auto instance = new DeleteArtistTileBehavior(); instance->museum = &museum; return unique_ptr(instance); }