From d8289105193707daede1a5b59137f18e20f20aeb Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Fri, 18 Oct 2024 15:48:14 +0200 Subject: (2/2) rename --- TileColorFactory.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 TileColorFactory.cpp (limited to 'TileColorFactory.cpp') 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; +} + -- cgit v1.2.3