diff options
author | wvpm <24685035+wvpm@users.noreply.github.com> | 2024-11-03 22:23:39 +0100 |
---|---|---|
committer | wvpm <24685035+wvpm@users.noreply.github.com> | 2024-11-03 22:39:01 +0100 |
commit | 4eba08af501560e9139a562c53fbbc8b694fb4cf (patch) | |
tree | e9553d2f4ed09abb920921006b976c7ef4baa46c /src/openvic-simulation/map/MapInstance.cpp | |
parent | 19026ff6aee8748df4777ec044065d13460e806a (diff) |
ModifierEffectCache & location to fieldsto_fields
Diffstat (limited to 'src/openvic-simulation/map/MapInstance.cpp')
-rw-r--r-- | src/openvic-simulation/map/MapInstance.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/openvic-simulation/map/MapInstance.cpp b/src/openvic-simulation/map/MapInstance.cpp index 80aad5e..85ff042 100644 --- a/src/openvic-simulation/map/MapInstance.cpp +++ b/src/openvic-simulation/map/MapInstance.cpp @@ -43,6 +43,7 @@ ProvinceDefinition::index_t MapInstance::get_selected_province_index() const { bool MapInstance::setup( BuildingTypeManager const& building_type_manager, + ModifierEffectCache const& modifier_effect_cache, decltype(ProvinceInstance::pop_type_distribution)::keys_t const& pop_type_keys, decltype(ProvinceInstance::ideology_distribution)::keys_t const& ideology_keys ) { @@ -60,7 +61,12 @@ bool MapInstance::setup( province_instances.reserve(map_definition.get_province_definition_count()); for (ProvinceDefinition const& province : map_definition.get_province_definitions()) { - ret &= province_instances.add_item({ province, pop_type_keys, ideology_keys }); + ret &= province_instances.add_item({ + modifier_effect_cache, + province, + pop_type_keys, + ideology_keys + }); } province_instances.lock(); @@ -152,20 +158,19 @@ void MapInstance::update_gamestate(const Date today, DefineManager const& define state_manager.update_gamestate(); } -void MapInstance::map_tick(const Date today, ModifierEffectCache const& modifier_effect_cache) { +void MapInstance::map_tick(const Date today) { for (ProvinceInstance& province : province_instances.get_items()) { - province.province_tick(today, modifier_effect_cache); + province.province_tick(today); } } void MapInstance::initialise_for_new_game( const Date today, - DefineManager const& define_manager, - ModifierEffectCache const& modifier_effect_cache + DefineManager const& define_manager ) { update_gamestate(today, define_manager); for (ProvinceInstance& province : province_instances.get_items()) { - province.initialise_rgo(modifier_effect_cache); + province.initialise_rgo(); } - state_manager.tick(today, modifier_effect_cache); + state_manager.tick(today); }
\ No newline at end of file |