diff options
Diffstat (limited to 'TileColorFactory.cpp')
-rw-r--r-- | TileColorFactory.cpp | 19 |
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; +} + |