diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-21 14:02:34 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-21 14:02:34 +0200 |
commit | fe8f7273f0efdfe319a0d3e3b2fc2847992745af (patch) | |
tree | 9f56560c8a35c3e281881fa48cd79b26f8e8de7e /CreateArtistTileBehavior.cpp | |
parent | 4cb7ca42003c177e3acc80075d7594e555966106 (diff) |
fix more design
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); -} - |