From fe8f7273f0efdfe319a0d3e3b2fc2847992745af Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Mon, 21 Oct 2024 14:02:34 +0200 Subject: fix more design --- Tile.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'Tile.cpp') diff --git a/Tile.cpp b/Tile.cpp index f4fa623..5172c24 100644 --- a/Tile.cpp +++ b/Tile.cpp @@ -19,17 +19,13 @@ void Tile::set_type(const string & type) { void Tile::set_data(TileData & data) { this->data = data; this->color = TileColorFactory::get_color(this->data.type); - this->behavior = TileBehaviorFactory::get_strategy(this->data.type).clone(this->museum); + this->behavior = TileBehaviorFactory(this->museum).create(this->data.type); } void Tile::update() { this->behavior->update(*this); } -void Tile::step(Artist * artist) { - this->behavior->step(artist); -} - Tile * Tile::get_neighbor(int dx, int dy) { Canvas & canvas = this->museum.canvas; int x = this->data.x + dx; -- cgit v1.2.3