From 3770de7a03879a8ff6b8cf22b402217c19fa2b53 Mon Sep 17 00:00:00 2001 From: Spartan322 Date: Mon, 18 Dec 2023 21:41:57 -0500 Subject: Change colour_t to be a strongly typed structure Make RGB default of `colour_t` Distinguish RGB and ARGB colors by type and colour_traits Add `_colour` and `_argb` colour user-defined literals Add `OpenVic::utility::unreachable` --- src/openvic-simulation/country/Country.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/openvic-simulation/country/Country.cpp') diff --git a/src/openvic-simulation/country/Country.cpp b/src/openvic-simulation/country/Country.cpp index cb4de8a..299407c 100644 --- a/src/openvic-simulation/country/Country.cpp +++ b/src/openvic-simulation/country/Country.cpp @@ -31,7 +31,7 @@ Country::Country( std::string_view new_identifier, colour_t new_colour, GraphicalCultureType const& new_graphical_culture, IdentifierRegistry&& new_parties, unit_names_map_t&& new_unit_names, bool new_dynamic_tag, government_colour_map_t&& new_alternative_colours -) : HasIdentifierAndColour { new_identifier, new_colour, false, false }, graphical_culture { new_graphical_culture }, +) : HasIdentifierAndColour { new_identifier, new_colour, false }, graphical_culture { new_graphical_culture }, parties { std::move(new_parties) }, unit_names { std::move(new_unit_names) }, dynamic_tag { new_dynamic_tag }, alternative_colours { std::move(new_alternative_colours) } {} @@ -50,10 +50,6 @@ bool CountryManager::add_country( ); return false; } - if (colour > MAX_COLOUR_RGB) { - Logger::error("Invalid country colour for ", identifier, ": ", colour_to_hex_string(colour)); - return false; - } if (graphical_culture == nullptr) { Logger::error("Null graphical culture for country ", identifier); return false; -- cgit v1.2.3-56-ga3b1