From 277157b3e06b2deeacbdbc8bf6190de19f88169d Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 23 Oct 2024 16:09:47 +0200 Subject: more refactoring / preparation for pathfinding --- TileColorFactory.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'TileColorFactory.h') diff --git a/TileColorFactory.h b/TileColorFactory.h index 83dfeed..4394c9e 100644 --- a/TileColorFactory.h +++ b/TileColorFactory.h @@ -9,15 +9,11 @@ class TileColorFactory { typedef std::map TileAppearanceCollection; public: - static Color get_color(std::string); - static void register_color(std::string, Color); + const Color & get_color(const std::string &); + void register_color(const std::string &, const Color &); private: - static TileAppearanceCollection & get_collection() { - static TileAppearanceCollection c = {}; - return c; - } - + TileAppearanceCollection collection; static constexpr Color default_color = { .red = 0xff, .green = 0xff, -- cgit v1.2.3