diff options
author | wvpm <24685035+wvpm@users.noreply.github.com> | 2024-11-02 15:20:30 +0100 |
---|---|---|
committer | wvpm <24685035+wvpm@users.noreply.github.com> | 2024-11-10 10:22:44 +0100 |
commit | 55eb6aab174172b63c44d801823ed8dc02ff0402 (patch) | |
tree | 5dc169ed65e3b86ce8307667f5c15d8fb54e3589 /src/openvic-simulation/map/ProvinceInstance.hpp | |
parent | 9868a5d6755889e3558f252475ae6d7599b788ac (diff) |
Cache pops by type per state and provincestate_cache_owners
Diffstat (limited to 'src/openvic-simulation/map/ProvinceInstance.hpp')
-rw-r--r-- | src/openvic-simulation/map/ProvinceInstance.hpp | 9 |
1 files changed, 6 insertions, 3 deletions
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<PopType, Pop::pop_size_t> PROPERTY(pop_type_distribution); + IndexedMap<PopType, std::vector<Pop*>> PROPERTY(pops_cache_by_type); IndexedMap<Ideology, fixed_point_t> PROPERTY(ideology_distribution); fixed_point_map_t<Culture const*> PROPERTY(culture_distribution); fixed_point_map_t<Religion const*> PROPERTY(religion_distribution); @@ -148,8 +149,8 @@ namespace OpenVic { ) const; std::vector<ModifierSum::modifier_entry_t> 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<UnitType::branch_t Branch> bool add_unit_instance_group(UnitInstanceGroup<Branch>& 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<Pop>& get_mutable_pops(); + IndexedMap<PopType, std::vector<Pop*>>& get_mutable_pops_cache_by_type(); }; } |