diff --git a/src/game_config.cpp b/src/game_config.cpp index f463de8436d..777ad383ea0 100644 --- a/src/game_config.cpp +++ b/src/game_config.cpp @@ -140,11 +140,11 @@ std::vector red_green_scale_text; static std::vector blue_white_scale; static std::vector blue_white_scale_text; -std::map team_rgb_range; +std::map> team_rgb_range; // Map [color_range]id to [color_range]name, or "" if no name -std::map team_rgb_name; +std::map> team_rgb_name; -std::map> team_rgb_colors; +std::map, std::less<>> team_rgb_colors; std::vector default_colors; @@ -501,7 +501,7 @@ void reset_color_info() team_rgb_range.clear(); } -const color_range& color_info(const std::string& name) +const color_range& color_info(std::string_view name) { auto i = team_rgb_range.find(name); if(i != team_rgb_range.end()) { @@ -521,7 +521,7 @@ const color_range& color_info(const std::string& name) return color_info(name); } -const std::vector& tc_info(const std::string& name) +const std::vector& tc_info(std::string_view name) { auto i = team_rgb_colors.find(name); if(i != team_rgb_colors.end()) { diff --git a/src/game_config.hpp b/src/game_config.hpp index 93ea6f89318..866b677e69c 100644 --- a/src/game_config.hpp +++ b/src/game_config.hpp @@ -157,9 +157,9 @@ namespace game_config * Colors defined by WML [color_range] tags. In addition to team colors such as "red" and * "blue", this also contains the colors used on the minimap for "cave", "fungus" etc. */ - extern std::map team_rgb_range; - extern std::map team_rgb_name; - extern std::map> team_rgb_colors; + extern std::map> team_rgb_range; + extern std::map> team_rgb_name; + extern std::map, std::less<>> team_rgb_colors; extern std::vector default_colors; @@ -187,8 +187,8 @@ namespace game_config void add_color_info(const game_config_view& v); void reset_color_info(); - const std::vector& tc_info(const std::string& name); - const color_range& color_info(const std::string& name); + const std::vector& tc_info(std::string_view name); + const color_range& color_info(std::string_view name); /** * Return a color corresponding to the value val