diff options
Diffstat (limited to 'RedTileBehavior.cpp')
-rw-r--r-- | RedTileBehavior.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/RedTileBehavior.cpp b/RedTileBehavior.cpp index 0f0426d..091a251 100644 --- a/RedTileBehavior.cpp +++ b/RedTileBehavior.cpp @@ -1,28 +1,28 @@ #include <memory> -#include "RedTileBehavior.h" -#include "BlueTileBehavior.h" +#include "DeleteArtistTileBehavior.h" +#include "SetNeighborTileBehavior.h" #include "Tile.h" #include "Museum.h" using namespace std; -RedTileBehavior RedTileBehavior::instance { RedTileBehavior::type }; +DeleteArtistTileBehavior DeleteArtistTileBehavior::instance { DeleteArtistTileBehavior::type }; -void RedTileBehavior::step(Artist * artist) { +void DeleteArtistTileBehavior::step(Artist * artist) { this->interactions++; if (artist != nullptr) this->museum->people.remove_artist(*artist); } -void RedTileBehavior::update(Tile & tile) { +void DeleteArtistTileBehavior::update(Tile & tile) { if (this->interactions == 0) return; - tile.set_type(BlueTileBehavior::type); + tile.set_type(SetNeighborTileBehavior::type); } -unique_ptr<TileBehaviorStrategy> RedTileBehavior::clone(Museum & museum) { - auto instance = new RedTileBehavior(); +unique_ptr<TileBehavior> DeleteArtistTileBehavior::clone(Museum & museum) { + auto instance = new DeleteArtistTileBehavior(); instance->museum = &museum; - return unique_ptr<TileBehaviorStrategy>(instance); + return unique_ptr<TileBehavior>(instance); } |