diff options
author | hop311 <hop3114@gmail.com> | 2024-07-21 15:09:25 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-07-22 20:21:27 +0200 |
commit | 67cbd14630c4344902d3fa1ddca178809da4293b (patch) | |
tree | 9df96829dd0f9a0bd7c2e6b0e047547aa4bff3a7 /src/openvic-simulation/map/Mapmode.cpp | |
parent | d1f3a96b72dd06b5f97dd4643e5f016a02b42ea6 (diff) |
Fleshing out Country, State and Province instances + historycountry-instance
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)()); |