#include #include "TileBehaviorFactory.h" #include "CreateArtistTileBehavior.h" #include "DeleteArtistTileBehavior.h" #include "NullTileBehavior.h" #include "SetNeighborTileBehavior.h" #include "StepTileBehavior.h" using namespace std; TileBehaviorFactory::TileBehaviorFactory(Museum & m) : museum(m) {}; unique_ptr TileBehaviorFactory::create(string type) { TileBehavior * out = nullptr; if (type == SetNeighborTileBehavior::type) out = new SetNeighborTileBehavior(this->museum); else if (type == CreateArtistTileBehavior::type) out = new CreateArtistTileBehavior(this->museum); else if (type == StepTileBehavior::type) out = new StepTileBehavior(this->museum); else if (type == DeleteArtistTileBehavior::type) out = new DeleteArtistTileBehavior(this->museum); if (out == nullptr) out = new NullTileBehavior(this->museum); return unique_ptr(out); }