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 --- TileBehaviorFactory.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'TileBehaviorFactory.h') diff --git a/TileBehaviorFactory.h b/TileBehaviorFactory.h index 33cd795..6167067 100644 --- a/TileBehaviorFactory.h +++ b/TileBehaviorFactory.h @@ -1,21 +1,16 @@ #pragma once -#include #include +#include "Museum.h" #include "TileBehavior.h" class TileBehaviorFactory { - typedef std::map TileBehaviorCollection; - public: - static TileBehavior & get_strategy(std::string); - static void register_strategy(std::string, TileBehavior *); + TileBehaviorFactory(Museum & m); + std::unique_ptr create(std::string); private: - static TileBehaviorCollection & get_collection() { - static TileBehaviorCollection c = {}; - return c; - } + Museum & museum; }; -- cgit v1.2.3