From 6cca4197183cc2e996b4af4dfc2daa02c65fa888 Mon Sep 17 00:00:00 2001 From: wvpm <24685035+wvpm@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:07:15 +0100 Subject: [PATCH] Add market placeholder --- src/openvic-simulation/InstanceManager.cpp | 7 ++- src/openvic-simulation/InstanceManager.hpp | 2 + .../economy/GoodInstance.cpp | 40 +++++++++++++- .../economy/GoodInstance.hpp | 22 +++++++- .../production/ResourceGatheringOperation.cpp | 52 +++++++++++-------- .../production/ResourceGatheringOperation.hpp | 11 ++-- .../economy/trading/MarketInstance.cpp | 19 +++++++ .../economy/trading/MarketInstance.hpp | 15 ++++++ .../economy/trading/MarketSellOrder.cpp | 19 +++++++ .../economy/trading/MarketSellOrder.hpp | 34 ++++++++++++ .../economy/trading/SellResult.hpp | 17 ++++++ src/openvic-simulation/map/MapInstance.cpp | 4 +- src/openvic-simulation/map/MapInstance.hpp | 2 + .../map/ProvinceInstance.cpp | 3 +- .../map/ProvinceInstance.hpp | 2 + 15 files changed, 215 insertions(+), 34 deletions(-) create mode 100644 src/openvic-simulation/economy/trading/MarketInstance.cpp create mode 100644 src/openvic-simulation/economy/trading/MarketInstance.hpp create mode 100644 src/openvic-simulation/economy/trading/MarketSellOrder.cpp create mode 100644 src/openvic-simulation/economy/trading/MarketSellOrder.hpp create mode 100644 src/openvic-simulation/economy/trading/SellResult.hpp diff --git a/src/openvic-simulation/InstanceManager.cpp b/src/openvic-simulation/InstanceManager.cpp index 277b4394..2085d6d7 100644 --- a/src/openvic-simulation/InstanceManager.cpp +++ b/src/openvic-simulation/InstanceManager.cpp @@ -9,6 +9,7 @@ InstanceManager::InstanceManager( DefinitionManager const& new_definition_manager, gamestate_updated_func_t gamestate_updated_callback, SimulationClock::state_changed_function_t clock_state_changed_callback ) : definition_manager { new_definition_manager }, + market_instance { good_instance_manager }, map_instance { new_definition_manager.get_map_definition() }, simulation_clock { std::bind(&InstanceManager::tick, this), std::bind(&InstanceManager::update_gamestate, this), @@ -21,7 +22,8 @@ InstanceManager::InstanceManager( today {}, gamestate_updated { gamestate_updated_callback ? std::move(gamestate_updated_callback) : []() {} }, gamestate_needs_update { false }, - currently_updating_gamestate { false } {} + currently_updating_gamestate { false } + {} void InstanceManager::set_gamestate_needs_update() { if (!currently_updating_gamestate) { @@ -62,6 +64,7 @@ void InstanceManager::tick() { // Tick... map_instance.map_tick(today); + market_instance.execute_orders(); set_gamestate_needs_update(); } @@ -75,6 +78,7 @@ bool InstanceManager::setup() { bool ret = good_instance_manager.setup(definition_manager.get_economy_manager().get_good_definition_manager()); ret &= map_instance.setup( definition_manager.get_economy_manager().get_building_type_manager(), + market_instance, definition_manager.get_modifier_manager().get_modifier_effect_cache(), definition_manager.get_pop_manager().get_pop_types(), definition_manager.get_politics_manager().get_ideology_manager().get_ideologies() @@ -145,6 +149,7 @@ bool InstanceManager::load_bookmark(Bookmark const* new_bookmark) { today, definition_manager.get_define_manager() ); + market_instance.execute_orders(); } return ret; diff --git a/src/openvic-simulation/InstanceManager.hpp b/src/openvic-simulation/InstanceManager.hpp index 05ae4122..418515b6 100644 --- a/src/openvic-simulation/InstanceManager.hpp +++ b/src/openvic-simulation/InstanceManager.hpp @@ -5,6 +5,7 @@ #include "openvic-simulation/country/CountryInstance.hpp" #include "openvic-simulation/diplomacy/CountryRelation.hpp" #include "openvic-simulation/economy/GoodInstance.hpp" +#include "openvic-simulation/economy/trading/MarketInstance.hpp" #include "openvic-simulation/map/MapInstance.hpp" #include "openvic-simulation/map/Mapmode.hpp" #include "openvic-simulation/military/UnitInstanceGroup.hpp" @@ -24,6 +25,7 @@ namespace OpenVic { CountryInstanceManager PROPERTY_REF(country_instance_manager); CountryRelationManager PROPERTY_REF(country_relation_manager); GoodInstanceManager PROPERTY_REF(good_instance_manager); + MarketInstance PROPERTY_REF(market_instance); UnitInstanceManager PROPERTY_REF(unit_instance_manager); /* Near the end so it is freed after other managers that may depend on it, * e.g. if we want to remove military units from the province they're in when they're destructed. */ diff --git a/src/openvic-simulation/economy/GoodInstance.cpp b/src/openvic-simulation/economy/GoodInstance.cpp index ac081c93..620b047e 100644 --- a/src/openvic-simulation/economy/GoodInstance.cpp +++ b/src/openvic-simulation/economy/GoodInstance.cpp @@ -3,8 +3,36 @@ using namespace OpenVic; GoodInstance::GoodInstance(GoodDefinition const& new_good_definition) - : HasIdentifierAndColour { new_good_definition }, good_definition { new_good_definition }, - price { new_good_definition.get_base_price() }, is_available { new_good_definition.get_is_available_from_start() } {} + : HasIdentifierAndColour { new_good_definition }, + sell_lock { std::make_unique() }, + good_definition { new_good_definition }, + price { new_good_definition.get_base_price() }, + is_available { new_good_definition.get_is_available_from_start() }, + total_supply_yesterday { fixed_point_t::_0() }, + market_sell_orders {} + {} + +void GoodInstance::add_market_sell_order(GoodMarketSellOrder&& market_sell_order) { + const std::lock_guard lock {*sell_lock}; + market_sell_orders.push_back(std::move(market_sell_order)); +} + +void GoodInstance::execute_orders() { + const fixed_point_t price = get_price(); + + fixed_point_t supply_running_total = fixed_point_t::_0(); + for(GoodMarketSellOrder const& market_sell_order : market_sell_orders) { + const fixed_point_t market_sell_quantity = market_sell_order.get_quantity(); + supply_running_total += market_sell_quantity; + market_sell_order.get_after_trade()({ + market_sell_quantity, + market_sell_quantity * price + }); + } + + total_supply_yesterday = supply_running_total; + market_sell_orders.clear(); +} bool GoodInstanceManager::setup(GoodDefinitionManager const& good_definition_manager) { if (good_instances_are_locked()) { @@ -24,3 +52,11 @@ bool GoodInstanceManager::setup(GoodDefinitionManager const& good_definition_man return ret; } + +GoodInstance& GoodInstanceManager::get_good_instance_from_definition(GoodDefinition const& good) { + return good_instances.get_items()[good.get_index()]; +} + +GoodInstance const& GoodInstanceManager::get_good_instance_from_definition(GoodDefinition const& good) const { + return good_instances.get_items()[good.get_index()]; +} \ No newline at end of file diff --git a/src/openvic-simulation/economy/GoodInstance.hpp b/src/openvic-simulation/economy/GoodInstance.hpp index 74ec9395..76c14a84 100644 --- a/src/openvic-simulation/economy/GoodInstance.hpp +++ b/src/openvic-simulation/economy/GoodInstance.hpp @@ -1,6 +1,12 @@ #pragma once +#include +#include +#include + #include "openvic-simulation/economy/GoodDefinition.hpp" +#include "openvic-simulation/economy/trading/MarketSellOrder.hpp" +#include "openvic-simulation/types/fixed_point/FixedPoint.hpp" #include "openvic-simulation/types/HasIdentifier.hpp" #include "openvic-simulation/types/IdentifierRegistry.hpp" #include "openvic-simulation/utility/Getters.hpp" @@ -12,15 +18,23 @@ namespace OpenVic { friend struct GoodInstanceManager; private: + std::unique_ptr sell_lock; GoodDefinition const& PROPERTY(good_definition); fixed_point_t PROPERTY(price); bool PROPERTY(is_available); - // TODO - supply, demand, actual bought - + fixed_point_t PROPERTY(total_supply_yesterday); + std::deque market_sell_orders; + GoodInstance(GoodDefinition const& new_good_definition); public: GoodInstance(GoodInstance&&) = default; + + //thread safe + void add_market_sell_order(GoodMarketSellOrder&& market_sell_order); + + //not thread safe + void execute_orders(); }; struct GoodInstanceManager { @@ -28,6 +42,10 @@ namespace OpenVic { IdentifierRegistry IDENTIFIER_REGISTRY(good_instance); public: + IDENTIFIER_REGISTRY_NON_CONST_ACCESSORS(good_instance); bool setup(GoodDefinitionManager const& good_definition_manager); + + GoodInstance& get_good_instance_from_definition(GoodDefinition const& good); + GoodInstance const& get_good_instance_from_definition(GoodDefinition const& good) const; }; } diff --git a/src/openvic-simulation/economy/production/ResourceGatheringOperation.cpp b/src/openvic-simulation/economy/production/ResourceGatheringOperation.cpp index 7d547eb0..85916d1d 100644 --- a/src/openvic-simulation/economy/production/ResourceGatheringOperation.cpp +++ b/src/openvic-simulation/economy/production/ResourceGatheringOperation.cpp @@ -4,6 +4,7 @@ #include "openvic-simulation/economy/production/Employee.hpp" #include "openvic-simulation/economy/production/ProductionType.hpp" +#include "openvic-simulation/economy/trading/SellResult.hpp" #include "openvic-simulation/map/ProvinceInstance.hpp" #include "openvic-simulation/map/State.hpp" #include "openvic-simulation/modifier/ModifierEffectCache.hpp" @@ -14,6 +15,7 @@ using namespace OpenVic; ResourceGatheringOperation::ResourceGatheringOperation( + MarketInstance& new_market_instance, ModifierEffectCache const& new_modifier_effect_cache, ProductionType const* new_production_type_nullable, fixed_point_t new_size_multiplier, @@ -22,7 +24,8 @@ ResourceGatheringOperation::ResourceGatheringOperation( fixed_point_t new_unsold_quantity_yesterday, std::vector&& new_employees, decltype(employee_count_per_type_cache)::keys_t const& pop_type_keys -) : modifier_effect_cache { new_modifier_effect_cache }, +) : market_instance { new_market_instance }, + modifier_effect_cache { new_modifier_effect_cache }, location_ptr { nullptr }, production_type_nullable { new_production_type_nullable }, revenue_yesterday { new_revenue_yesterday }, @@ -39,9 +42,11 @@ ResourceGatheringOperation::ResourceGatheringOperation( { } ResourceGatheringOperation::ResourceGatheringOperation( + MarketInstance& new_market_instance, ModifierEffectCache const& new_modifier_effect_cache, decltype(employee_count_per_type_cache)::keys_t const& pop_type_keys ) : ResourceGatheringOperation { + new_market_instance, new_modifier_effect_cache, nullptr, fixed_point_t::_0(), fixed_point_t::_0(), fixed_point_t::_0(), @@ -134,27 +139,33 @@ void ResourceGatheringOperation::rgo_tick() { hire(total_worker_count_in_province); pop_size_t total_owner_count_in_state_cache = 0; - std::vector const* owner_pops_cache = nullptr; + std::vector const* owner_pops_cache_nullable = nullptr; if (production_type.get_owner().has_value()) { PopType const& owner_pop_type = *production_type.get_owner()->get_pop_type(); total_owner_count_in_state_cache = location.get_state()->get_pop_type_distribution()[owner_pop_type]; - owner_pops_cache = &location.get_state()->get_pops_cache_by_type()[owner_pop_type]; + owner_pops_cache_nullable = &location.get_state()->get_pops_cache_by_type()[owner_pop_type]; } - output_quantity_yesterday = produce( - owner_pops_cache, - total_owner_count_in_state_cache - ); - - revenue_yesterday = output_quantity_yesterday * production_type.get_output_good().get_base_price(); //TODO sell on market - - pay_employees( - revenue_yesterday, - total_worker_count_in_province, - owner_pops_cache, - total_owner_count_in_state_cache - ); + output_quantity_yesterday = produce(total_owner_count_in_state_cache); + market_instance.place_market_sell_order({ + production_type.get_output_good(), + output_quantity_yesterday, + [ + this, + total_worker_count_in_province, + owner_pops_cache_nullable, + total_owner_count_in_state_cache + ](const SellResult sell_result) -> void { + revenue_yesterday = sell_result.get_money_gained(); + pay_employees( + revenue_yesterday, + total_worker_count_in_province, + owner_pops_cache_nullable, + total_owner_count_in_state_cache + ); + } + }); } void ResourceGatheringOperation::hire(const pop_size_t available_worker_count) { @@ -199,10 +210,7 @@ void ResourceGatheringOperation::hire(const pop_size_t available_worker_count) { } } -fixed_point_t ResourceGatheringOperation::produce( - std::vector const* const owner_pops_cache, - const pop_size_t total_owner_count_in_state_cache -) { +fixed_point_t ResourceGatheringOperation::produce(const pop_size_t total_owner_count_in_state_cache) { const fixed_point_t size_modifier = calculate_size_modifier(); if (size_modifier == fixed_point_t::_0()){ return fixed_point_t::_0(); @@ -304,7 +312,7 @@ fixed_point_t ResourceGatheringOperation::produce( void ResourceGatheringOperation::pay_employees( const fixed_point_t revenue, const pop_size_t total_worker_count_in_province, - std::vector const* const owner_pops_cache, + std::vector const* const owner_pops_cache_nullable, const pop_size_t total_owner_count_in_state_cache ) { ProvinceInstance& location = *location_ptr; @@ -325,7 +333,7 @@ void ResourceGatheringOperation::pay_employees( owner_share = upper_limit; } - for(Pop* owner_pop_ptr : *owner_pops_cache) { + for(Pop* owner_pop_ptr : *owner_pops_cache_nullable) { Pop& owner_pop = *owner_pop_ptr; const fixed_point_t income_for_this_pop = revenue_left * owner_share * owner_pop.get_size() / total_owner_count_in_state_cache; owner_pop.add_rgo_owner_income(income_for_this_pop); diff --git a/src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp b/src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp index 6b514e31..3af39ae6 100644 --- a/src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp +++ b/src/openvic-simulation/economy/production/ResourceGatheringOperation.hpp @@ -2,6 +2,7 @@ #include "openvic-simulation/economy/production/Employee.hpp" #include "openvic-simulation/economy/production/ProductionType.hpp" +#include "openvic-simulation/economy/trading/MarketInstance.hpp" #include "openvic-simulation/pop/Pop.hpp" #include "openvic-simulation/types/fixed_point/FixedPoint.hpp" #include "openvic-simulation/utility/Getters.hpp" @@ -12,6 +13,7 @@ namespace OpenVic { struct ResourceGatheringOperation { private: + MarketInstance& market_instance; ModifierEffectCache const& modifier_effect_cache; ProvinceInstance* location_ptr; ProductionType const* PROPERTY_RW(production_type_nullable); @@ -29,19 +31,17 @@ namespace OpenVic { fixed_point_t calculate_size_modifier() const; void hire(const pop_size_t available_worker_count); - fixed_point_t produce( - std::vector const* const owner_pops_cache, - const pop_size_t total_owner_count_in_state_cache - ); + fixed_point_t produce(const pop_size_t total_owner_count_in_state_cache); void pay_employees( const fixed_point_t revenue, const pop_size_t total_worker_count_in_province, - std::vector const* const owner_pops_cache, + std::vector const* const owner_pops_cache_nullable, const pop_size_t total_owner_count_in_state_cache ); public: ResourceGatheringOperation( + MarketInstance& new_market_instance, ModifierEffectCache const& new_modifier_effect_cache, ProductionType const* new_production_type_nullable, fixed_point_t new_size_multiplier, @@ -53,6 +53,7 @@ namespace OpenVic { ); ResourceGatheringOperation( + MarketInstance& new_market_instance, ModifierEffectCache const& new_modifier_effect_cache, decltype(employee_count_per_type_cache)::keys_t const& pop_type_keys ); diff --git a/src/openvic-simulation/economy/trading/MarketInstance.cpp b/src/openvic-simulation/economy/trading/MarketInstance.cpp new file mode 100644 index 00000000..3c9198a2 --- /dev/null +++ b/src/openvic-simulation/economy/trading/MarketInstance.cpp @@ -0,0 +1,19 @@ +#include "MarketInstance.hpp" + +using namespace OpenVic; + +MarketInstance::MarketInstance(GoodInstanceManager& new_good_instance_manager) +: good_instance_manager { new_good_instance_manager} {} + +void MarketInstance::place_market_sell_order(MarketSellOrder&& market_sell_order) { + GoodDefinition const& good = market_sell_order.get_good(); + GoodInstance& good_instance = good_instance_manager.get_good_instance_from_definition(good); + good_instance.add_market_sell_order(std::move(market_sell_order)); +} + +void MarketInstance::execute_orders() { + std::vector& good_instances = good_instance_manager.get_good_instances(); + for (GoodInstance& good_instance : good_instances) { + good_instance.execute_orders(); + } +} diff --git a/src/openvic-simulation/economy/trading/MarketInstance.hpp b/src/openvic-simulation/economy/trading/MarketInstance.hpp new file mode 100644 index 00000000..3f7e3692 --- /dev/null +++ b/src/openvic-simulation/economy/trading/MarketInstance.hpp @@ -0,0 +1,15 @@ +#pragma once + +#include "openvic-simulation/economy/GoodInstance.hpp" +#include "openvic-simulation/economy/trading/MarketSellOrder.hpp" + +namespace OpenVic { + struct MarketInstance { + private: + GoodInstanceManager& PROPERTY(good_instance_manager); + public: + MarketInstance(GoodInstanceManager& new_good_instance_manager); + void place_market_sell_order(MarketSellOrder&& market_sell_order); + void execute_orders(); + }; +} \ No newline at end of file diff --git a/src/openvic-simulation/economy/trading/MarketSellOrder.cpp b/src/openvic-simulation/economy/trading/MarketSellOrder.cpp new file mode 100644 index 00000000..4f89d2f6 --- /dev/null +++ b/src/openvic-simulation/economy/trading/MarketSellOrder.cpp @@ -0,0 +1,19 @@ +#include "MarketSellOrder.hpp" + +using namespace OpenVic; + +GoodMarketSellOrder::GoodMarketSellOrder( + const fixed_point_t new_quantity, + std::function&& new_after_trade +): + quantity { new_quantity }, + after_trade { std::move(new_after_trade) } + {} + +MarketSellOrder::MarketSellOrder( + GoodDefinition const& new_good, + const fixed_point_t new_quantity, + std::function&& new_after_trade +): GoodMarketSellOrder(new_quantity, std::move(new_after_trade)), + good { new_good } + {} \ No newline at end of file diff --git a/src/openvic-simulation/economy/trading/MarketSellOrder.hpp b/src/openvic-simulation/economy/trading/MarketSellOrder.hpp new file mode 100644 index 00000000..c17950f4 --- /dev/null +++ b/src/openvic-simulation/economy/trading/MarketSellOrder.hpp @@ -0,0 +1,34 @@ +#pragma once + +#include "openvic-simulation/economy/GoodDefinition.hpp" +#include "openvic-simulation/economy/trading/SellResult.hpp" +#include "openvic-simulation/types/fixed_point/FixedPoint.hpp" +#include "openvic-simulation/utility/Getters.hpp" + +namespace OpenVic { + struct GoodMarketSellOrder { + private: + const fixed_point_t PROPERTY(quantity); + std::function PROPERTY(after_trade); + + public: + GoodMarketSellOrder( + const fixed_point_t new_quantity, + std::function&& new_after_trade + ); + GoodMarketSellOrder(GoodMarketSellOrder&&) = default; + }; + + struct MarketSellOrder : GoodMarketSellOrder { + private: + GoodDefinition const& PROPERTY(good); + + public: + MarketSellOrder( + GoodDefinition const& new_good, + const fixed_point_t new_quantity, + std::function&& new_after_trade + ); + MarketSellOrder(MarketSellOrder&&) = default; + }; +} \ No newline at end of file diff --git a/src/openvic-simulation/economy/trading/SellResult.hpp b/src/openvic-simulation/economy/trading/SellResult.hpp new file mode 100644 index 00000000..50f5de15 --- /dev/null +++ b/src/openvic-simulation/economy/trading/SellResult.hpp @@ -0,0 +1,17 @@ +#pragma once + +#include "openvic-simulation/types/fixed_point/FixedPoint.hpp" + +namespace OpenVic { + struct SellResult { + private: + fixed_point_t PROPERTY(quantity_sold); + fixed_point_t PROPERTY(money_gained); + public: + constexpr SellResult( + const fixed_point_t new_quantity_sold, + const fixed_point_t new_money_gained + ) : quantity_sold { new_quantity_sold }, + money_gained { new_money_gained } {} + }; +} \ No newline at end of file diff --git a/src/openvic-simulation/map/MapInstance.cpp b/src/openvic-simulation/map/MapInstance.cpp index 759e9846..2cea6970 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, + MarketInstance& market_instance, 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 @@ -61,7 +62,8 @@ 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({ + ret &= province_instances.add_item({ + market_instance, modifier_effect_cache, province, pop_type_keys, diff --git a/src/openvic-simulation/map/MapInstance.hpp b/src/openvic-simulation/map/MapInstance.hpp index 8cdf6779..5c3c0937 100644 --- a/src/openvic-simulation/map/MapInstance.hpp +++ b/src/openvic-simulation/map/MapInstance.hpp @@ -1,5 +1,6 @@ #pragma once +#include "openvic-simulation/economy/trading/MarketInstance.hpp" #include "openvic-simulation/map/ProvinceDefinition.hpp" #include "openvic-simulation/map/ProvinceInstance.hpp" #include "openvic-simulation/map/State.hpp" @@ -44,6 +45,7 @@ namespace OpenVic { bool setup( BuildingTypeManager const& building_type_manager, + MarketInstance& market_instance, 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 diff --git a/src/openvic-simulation/map/ProvinceInstance.cpp b/src/openvic-simulation/map/ProvinceInstance.cpp index ebf45180..2cc580e1 100644 --- a/src/openvic-simulation/map/ProvinceInstance.cpp +++ b/src/openvic-simulation/map/ProvinceInstance.cpp @@ -17,6 +17,7 @@ using namespace OpenVic; ProvinceInstance::ProvinceInstance( + MarketInstance& new_market_instance, ModifierEffectCache const& new_modifier_effect_cache, ProvinceDefinition const& new_province_definition, decltype(pop_type_distribution)::keys_t const& pop_type_keys, @@ -34,7 +35,7 @@ ProvinceInstance::ProvinceInstance( event_modifiers {}, slave { false }, crime { nullptr }, - rgo { new_modifier_effect_cache, pop_type_keys }, + rgo { new_market_instance, new_modifier_effect_cache, pop_type_keys }, buildings { "buildings", false }, armies {}, navies {}, diff --git a/src/openvic-simulation/map/ProvinceInstance.hpp b/src/openvic-simulation/map/ProvinceInstance.hpp index f06c3159..14ea63cd 100644 --- a/src/openvic-simulation/map/ProvinceInstance.hpp +++ b/src/openvic-simulation/map/ProvinceInstance.hpp @@ -5,6 +5,7 @@ #include "openvic-simulation/economy/BuildingInstance.hpp" #include "openvic-simulation/economy/production/ProductionType.hpp" #include "openvic-simulation/economy/production/ResourceGatheringOperation.hpp" +#include "openvic-simulation/economy/trading/MarketInstance.hpp" #include "openvic-simulation/military/UnitInstance.hpp" #include "openvic-simulation/military/UnitType.hpp" #include "openvic-simulation/modifier/ModifierSum.hpp" @@ -105,6 +106,7 @@ namespace OpenVic { size_t PROPERTY(max_supported_regiments); ProvinceInstance( + MarketInstance& new_market_instance, ModifierEffectCache const& new_modifier_effect_cache, ProvinceDefinition const& new_province_definition, decltype(pop_type_distribution)::keys_t const& pop_type_keys,