aboutsummaryrefslogtreecommitdiff
path: root/TileColorFactory.cpp
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 /TileColorFactory.cpp
parent76e61d68bbf568ec0d7fc4632e52d4de5496b003 (diff)
(2/2) rename
Diffstat (limited to 'TileColorFactory.cpp')
-rw-r--r--TileColorFactory.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/TileColorFactory.cpp b/TileColorFactory.cpp
new file mode 100644
index 0000000..7c5b080
--- /dev/null
+++ b/TileColorFactory.cpp
@@ -0,0 +1,19 @@
+#include "TileColorFactory.h"
+
+using namespace std;
+
+Color TileColorFactory::get_color(string type) {
+ auto & type_map = TileColorFactory::get_collection();
+
+ if (type_map.contains(type))
+ return type_map.at(type);
+
+ return TileColorFactory::default_color;
+}
+
+void TileColorFactory::register_color(string type, Color color) {
+ auto & type_map = TileColorFactory::get_collection();
+
+ type_map[type] = color;
+}
+