From 55eb6aab174172b63c44d801823ed8dc02ff0402 Mon Sep 17 00:00:00 2001 From: wvpm <24685035+wvpm@users.noreply.github.com> Date: Sat, 2 Nov 2024 15:20:30 +0100 Subject: Cache pops by type per state and province --- src/openvic-simulation/map/ProvinceInstance.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/openvic-simulation/map/ProvinceInstance.hpp') diff --git a/src/openvic-simulation/map/ProvinceInstance.hpp b/src/openvic-simulation/map/ProvinceInstance.hpp index ba800a9..ec83af4 100644 --- a/src/openvic-simulation/map/ProvinceInstance.hpp +++ b/src/openvic-simulation/map/ProvinceInstance.hpp @@ -96,6 +96,7 @@ namespace OpenVic { fixed_point_t PROPERTY(average_consciousness); fixed_point_t PROPERTY(average_militancy); IndexedMap PROPERTY(pop_type_distribution); + IndexedMap> PROPERTY(pops_cache_by_type); IndexedMap PROPERTY(ideology_distribution); fixed_point_map_t PROPERTY(culture_distribution); fixed_point_map_t PROPERTY(religion_distribution); @@ -148,8 +149,8 @@ namespace OpenVic { ) const; std::vector get_contributing_modifiers(ModifierEffect const& effect) const; - void update_gamestate(Date today, DefineManager const& define_manager); - void tick(Date today); + void update_gamestate(const Date today, DefineManager const& define_manager); + void province_tick(const Date today, ModifierEffectCache const& modifier_effect_cache); template bool add_unit_instance_group(UnitInstanceGroup& group); @@ -159,9 +160,11 @@ namespace OpenVic { bool setup(BuildingTypeManager const& building_type_manager); bool apply_history_to_province(ProvinceHistoryEntry const& entry, CountryInstanceManager& country_manager); - void initialise_for_new_game(ModifierEffectCache const& modifier_effect_cache); + void initialise_rgo(ModifierEffectCache const& modifier_effect_cache); void setup_pop_test_values(IssueManager const& issue_manager); + State* get_mutable_state(); plf::colony& get_mutable_pops(); + IndexedMap>& get_mutable_pops_cache_by_type(); }; } -- cgit v1.2.3-56-ga3b1