diff options
Diffstat (limited to 'CreateArtistTileBehavior.cpp')
-rw-r--r-- | CreateArtistTileBehavior.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/CreateArtistTileBehavior.cpp b/CreateArtistTileBehavior.cpp index ae0cd7c..3e0f1c1 100644 --- a/CreateArtistTileBehavior.cpp +++ b/CreateArtistTileBehavior.cpp @@ -1,4 +1,3 @@ -#include <memory> #include <random> #include "CreateArtistTileBehavior.h" @@ -12,8 +11,6 @@ using std::random_device; using std::mt19937; using namespace std; -CreateArtistTileBehavior CreateArtistTileBehavior::instance { CreateArtistTileBehavior::type }; - random_device dev{}; mt19937 rng(dev()); uniform_int_distribution<int> random_bool(0, 1); @@ -31,16 +28,10 @@ void CreateArtistTileBehavior::update(Tile & tile) { }; float velocity = random_float(rng); random_bool(rng) ? new_data.vx = velocity : new_data.vy = velocity; - this->museum->people.add_artist(new_data); + this->museum.people.add_artist(new_data); } if (this->interactions < 2) return; tile.set_type(StepTileBehavior::type); } -unique_ptr<TileBehavior> CreateArtistTileBehavior::clone(Museum & museum) { - auto instance = new CreateArtistTileBehavior(); - instance->museum = &museum; - return unique_ptr<TileBehavior>(instance); -} - |