diff options
author | Hop311 <Hop3114@gmail.com> | 2024-07-23 19:47:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-23 19:47:47 +0200 |
commit | 6cd55c452d1643666ff4169a89402fd3e3b66c61 (patch) | |
tree | 888b847a54c66b6e9d1b2f7ee3e3d0f8071eceda /src/openvic-simulation/map/Mapmode.cpp | |
parent | 9d57ca273e4b32ab82a51789ec58e08fefb5276a (diff) | |
parent | 67cbd14630c4344902d3fa1ddca178809da4293b (diff) |
Merge pull request #177 from OpenVicProject/country-instance
Fleshing out Country, State and Province instances + history
Diffstat (limited to 'src/openvic-simulation/map/Mapmode.cpp')
-rw-r--r-- | src/openvic-simulation/map/Mapmode.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/openvic-simulation/map/Mapmode.cpp b/src/openvic-simulation/map/Mapmode.cpp index c47a07a..cab67d1 100644 --- a/src/openvic-simulation/map/Mapmode.cpp +++ b/src/openvic-simulation/map/Mapmode.cpp @@ -2,7 +2,7 @@ #include <cassert> -#include "openvic-simulation/country/CountryDefinition.hpp" +#include "openvic-simulation/country/CountryInstance.hpp" #include "openvic-simulation/map/MapDefinition.hpp" #include "openvic-simulation/map/MapInstance.hpp" #include "openvic-simulation/map/ProvinceDefinition.hpp" @@ -90,7 +90,7 @@ static constexpr colour_argb_t DEFAULT_COLOUR_WHITE = (0xFFFFFF_argb).with_alpha * national focus, RGO, population density, sphere of influence, ranking and migration. */ static constexpr colour_argb_t DEFAULT_COLOUR_GREY = (0x7F7F7F_argb).with_alpha(ALPHA_VALUE); -template<utility::is_derived_from_specialization_of<_HasColour> T, typename P> +template<HasGetColour T, typename P> requires(std::same_as<P, ProvinceDefinition> || std::same_as<P, ProvinceInstance>) static constexpr auto get_colour_mapmode(T const*(P::*get_item)() const) { return [get_item](MapInstance const&, ProvinceInstance const& province) -> Mapmode::base_stripe_t { @@ -114,7 +114,7 @@ static constexpr auto get_colour_mapmode(T const*(P::*get_item)() const) { }; } -template<utility::is_derived_from_specialization_of<_HasColour> T> +template<HasGetColour T> static constexpr Mapmode::base_stripe_t shaded_mapmode(fixed_point_map_t<T const*> const& map) { const std::pair<fixed_point_map_const_iterator_t<T const*>, fixed_point_map_const_iterator_t<T const*>> largest = get_largest_two_items(map); @@ -132,7 +132,7 @@ static constexpr Mapmode::base_stripe_t shaded_mapmode(fixed_point_map_t<T const return colour_argb_t::null(); } -template<utility::is_derived_from_specialization_of<_HasColour> T> +template<HasGetColour T> static constexpr auto shaded_mapmode(fixed_point_map_t<T const*> const&(ProvinceInstance::*get_map)() const) { return [get_map](MapInstance const&, ProvinceInstance const& province) -> Mapmode::base_stripe_t { return shaded_mapmode((province.*get_map)()); |