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 /TileBehaviorFactory.h | |
parent | 4cb7ca42003c177e3acc80075d7594e555966106 (diff) |
fix more design
Diffstat (limited to 'TileBehaviorFactory.h')
-rw-r--r-- | TileBehaviorFactory.h | 13 |
1 files changed, 4 insertions, 9 deletions
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 <map> #include <string> +#include "Museum.h" #include "TileBehavior.h" class TileBehaviorFactory { - typedef std::map<std::string, TileBehavior *> TileBehaviorCollection; - public: - static TileBehavior & get_strategy(std::string); - static void register_strategy(std::string, TileBehavior *); + TileBehaviorFactory(Museum & m); + std::unique_ptr<TileBehavior> create(std::string); private: - static TileBehaviorCollection & get_collection() { - static TileBehaviorCollection c = {}; - return c; - } + Museum & museum; }; |