aboutsummaryrefslogtreecommitdiff
path: root/TileBehaviorFactory.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-18 15:48:14 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-18 15:48:14 +0200
commitd8289105193707daede1a5b59137f18e20f20aeb (patch)
tree939908b9c4c6f7aaef8aa61ee2e04be3e85610b6 /TileBehaviorFactory.h
parent76e61d68bbf568ec0d7fc4632e52d4de5496b003 (diff)
(2/2) rename
Diffstat (limited to 'TileBehaviorFactory.h')
-rw-r--r--TileBehaviorFactory.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/TileBehaviorFactory.h b/TileBehaviorFactory.h
new file mode 100644
index 0000000..33cd795
--- /dev/null
+++ b/TileBehaviorFactory.h
@@ -0,0 +1,21 @@
+#pragma once
+
+#include <map>
+#include <string>
+
+#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 *);
+
+private:
+ static TileBehaviorCollection & get_collection() {
+ static TileBehaviorCollection c = {};
+ return c;
+ }
+};
+