diff options
author | George L. Albany <Megacake1234@gmail.com> | 2023-12-24 23:00:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-24 23:00:36 +0100 |
commit | bf4e7368600bb425b6612231fbb84de34ec99a27 (patch) | |
tree | d3b29714d3286b9edbe380f877bbce541344a635 /src/openvic-simulation/map/Map.hpp | |
parent | f036506b88af02508242f279ca29b743ef713976 (diff) | |
parent | 3770de7a03879a8ff6b8cf22b402217c19fa2b53 (diff) |
Merge pull request #100 from OpenVicProject/change/colour_t_to_struct
Diffstat (limited to 'src/openvic-simulation/map/Map.hpp')
-rw-r--r-- | src/openvic-simulation/map/Map.hpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/openvic-simulation/map/Map.hpp b/src/openvic-simulation/map/Map.hpp index 185e99e..9cee86b 100644 --- a/src/openvic-simulation/map/Map.hpp +++ b/src/openvic-simulation/map/Map.hpp @@ -6,8 +6,9 @@ #include <openvic-dataloader/csv/LineObject.hpp> #include "openvic-simulation/map/Region.hpp" -#include "openvic-simulation/map/TerrainType.hpp" #include "openvic-simulation/map/State.hpp" +#include "openvic-simulation/map/TerrainType.hpp" +#include "openvic-simulation/types/Colour.hpp" namespace OpenVic { namespace fs = std::filesystem; @@ -17,7 +18,13 @@ namespace OpenVic { /* Bottom 32 bits are the base colour, top 32 are the stripe colour, both in ARGB format with the alpha channels * controlling interpolation with the terrain colour (0 = all terrain, 255 = all corresponding RGB) */ - using base_stripe_t = uint64_t; + struct base_stripe_t { + colour_argb_t base_colour; + colour_argb_t stripe_colour; + constexpr base_stripe_t(colour_argb_t base, colour_argb_t stripe) + : base_colour { base }, stripe_colour { stripe } {} + constexpr base_stripe_t(colour_argb_t both) : base_stripe_t { both, both } {} + }; using colour_func_t = std::function<base_stripe_t(Map const&, Province const&)>; using index_t = size_t; |