diff options
author | hop311 <hop3114@gmail.com> | 2024-07-17 00:57:50 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-07-17 00:58:05 +0200 |
commit | f83e869def6608f64606aead24ad1cfbb6f5c72a (patch) | |
tree | fae6a1086f3ae698c4fb3f18340c5ed5f580c889 /src/openvic-simulation/pop/Pop.hpp | |
parent | e8a3b33f13ebdf3a388b4996308b4db9763dc375 (diff) |
Add IndexedMap and use in low key count, high value density casesindexed-map
Diffstat (limited to 'src/openvic-simulation/pop/Pop.hpp')
-rw-r--r-- | src/openvic-simulation/pop/Pop.hpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/openvic-simulation/pop/Pop.hpp b/src/openvic-simulation/pop/Pop.hpp index 8ac6d4c..c74840f 100644 --- a/src/openvic-simulation/pop/Pop.hpp +++ b/src/openvic-simulation/pop/Pop.hpp @@ -10,6 +10,7 @@ #include "openvic-simulation/scripts/ConditionalWeight.hpp" #include "openvic-simulation/types/EnumBitfield.hpp" #include "openvic-simulation/types/fixed_point/FixedPoint.hpp" +#include "openvic-simulation/types/IndexedMap.hpp" namespace OpenVic { @@ -68,9 +69,9 @@ namespace OpenVic { fixed_point_t PROPERTY(literacy); - fixed_point_map_t<Ideology const*> PROPERTY(ideologies); + IndexedMap<Ideology, fixed_point_t> PROPERTY(ideologies); fixed_point_map_t<Issue const*> PROPERTY(issues); - fixed_point_map_t<CountryParty const*> PROPERTY(votes); + IndexedMap<CountryParty, fixed_point_t> PROPERTY(votes); fixed_point_t PROPERTY(unemployment); fixed_point_t PROPERTY(cash); @@ -81,7 +82,7 @@ namespace OpenVic { fixed_point_t PROPERTY(everyday_needs_fulfilled); fixed_point_t PROPERTY(luxury_needs_fulfilled); - Pop(PopBase const& pop_base); + Pop(PopBase const& pop_base, decltype(ideologies)::keys_t const& ideology_keys); public: Pop(Pop const&) = delete; @@ -89,9 +90,7 @@ namespace OpenVic { Pop& operator=(Pop const&) = delete; Pop& operator=(Pop&&) = delete; - void setup_pop_test_values( - IdeologyManager const& ideology_manager, IssueManager const& issue_manager, CountryDefinition const& country - ); + void setup_pop_test_values(IssueManager const& issue_manager); void set_location(ProvinceInstance const& new_location); }; |