From 8d5068c1db9a02a34d675536f41aee61ec3e482a Mon Sep 17 00:00:00 2001 From: hop311 Date: Thu, 29 Aug 2024 23:35:18 +0100 Subject: Load government flag overrides from history and apply them --- src/openvic-simulation/types/IndexedMap.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/openvic-simulation/types') diff --git a/src/openvic-simulation/types/IndexedMap.hpp b/src/openvic-simulation/types/IndexedMap.hpp index 30cf5cd..5682c0e 100644 --- a/src/openvic-simulation/types/IndexedMap.hpp +++ b/src/openvic-simulation/types/IndexedMap.hpp @@ -169,6 +169,16 @@ namespace OpenVic { return true; } + constexpr void write_non_empty_values(IndexedMap const& other) { + const size_t count = std::min(container_t::size(), other.size()); + for (size_t index = 0; index < count; ++index) { + value_t const& value = other[index]; + if (value) { + container_t::operator[](index) = value; + } + } + } + fixed_point_map_t to_fixed_point_map() const requires(std::same_as) { -- cgit v1.2.3-56-ga3b1