From 16349d6cad05497f983b1da123b6284ecfddd638 Mon Sep 17 00:00:00 2001 From: hop311 Date: Fri, 6 Sep 2024 23:07:27 +0100 Subject: Calculate country industrial power (states still need factory data) --- src/openvic-simulation/country/CountryInstance.hpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/openvic-simulation/country/CountryInstance.hpp') diff --git a/src/openvic-simulation/country/CountryInstance.hpp b/src/openvic-simulation/country/CountryInstance.hpp index 3622e29..0e8d493 100644 --- a/src/openvic-simulation/country/CountryInstance.hpp +++ b/src/openvic-simulation/country/CountryInstance.hpp @@ -75,7 +75,10 @@ namespace OpenVic { /* Production */ fixed_point_t PROPERTY(industrial_power); + std::vector> PROPERTY(industrial_power_from_states); + std::vector> PROPERTY(industrial_power_from_investments); size_t PROPERTY(industrial_rank); + fixed_point_map_t PROPERTY(foreign_investments); // TODO - total amount of each good produced /* Budget */ @@ -195,10 +198,18 @@ namespace OpenVic { template bool remove_leader(LeaderBranched const* leader); - bool apply_history_to_country(CountryHistoryEntry const* entry, MapInstance& map_instance); + // Sets the investment of each country in the map (rather than adding to them), leaving the rest unchanged. + void apply_foreign_investments( + fixed_point_map_t const& investments, + CountryInstanceManager const& country_instance_manager + ); + + bool apply_history_to_country( + CountryHistoryEntry const& entry, MapInstance& map_instance, CountryInstanceManager const& country_instance_manager + ); private: - void _update_production(); + void _update_production(DefineManager const& define_manager); void _update_budget(); void _update_technology(); void _update_politics(); @@ -209,7 +220,7 @@ namespace OpenVic { public: - void update_gamestate(); + void update_gamestate(DefineManager const& define_manager); void tick(); }; -- cgit v1.2.3-56-ga3b1