aboutsummaryrefslogtreecommitdiff
path: root/TileColorFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TileColorFactory.cpp')
-rw-r--r--TileColorFactory.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/TileColorFactory.cpp b/TileColorFactory.cpp
index 7c5b080..22738f6 100644
--- a/TileColorFactory.cpp
+++ b/TileColorFactory.cpp
@@ -2,18 +2,14 @@
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);
+const Color & TileColorFactory::get_color(const string & type) {
+ if (this->collection.contains(type))
+ return this->collection.at(type);
return TileColorFactory::default_color;
}
-void TileColorFactory::register_color(string type, Color color) {
- auto & type_map = TileColorFactory::get_collection();
-
- type_map[type] = color;
+void TileColorFactory::register_color(const string & type, const Color & color) {
+ this->collection[type] = color;
}