aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/country/CountryInstance.hpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-09-07 00:07:27 +0200
committer hop311 <hop3114@gmail.com>2024-09-08 18:24:57 +0200
commit16349d6cad05497f983b1da123b6284ecfddd638 (patch)
treeb22020c1221adc6633599a1ad53bf73bb62db0ad /src/openvic-simulation/country/CountryInstance.hpp
parentb5407c8794c4626d010bd0856a146095daa1042d (diff)
Calculate country industrial power (states still need factory data)
Diffstat (limited to 'src/openvic-simulation/country/CountryInstance.hpp')
-rw-r--r--src/openvic-simulation/country/CountryInstance.hpp17
1 files changed, 14 insertions, 3 deletions
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<std::pair<State const*, fixed_point_t>> PROPERTY(industrial_power_from_states);
+ std::vector<std::pair<CountryInstance const*, fixed_point_t>> PROPERTY(industrial_power_from_investments);
size_t PROPERTY(industrial_rank);
+ fixed_point_map_t<CountryInstance const*> PROPERTY(foreign_investments);
// TODO - total amount of each good produced
/* Budget */
@@ -195,10 +198,18 @@ namespace OpenVic {
template<UnitType::branch_t Branch>
bool remove_leader(LeaderBranched<Branch> 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<CountryDefinition const*> 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();
};