aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map/State.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-09-07 00:13:47 +0200
committer hop311 <hop3114@gmail.com>2024-09-09 19:25:27 +0200
commitd67cd2d08fe2859809e35b93f5a8358c48a3705e (patch)
treee3f5b453affdb38e5a0c08513c404de652fce738 /src/openvic-simulation/map/State.cpp
parent16349d6cad05497f983b1da123b6284ecfddd638 (diff)
Calculate country military power (still needs modifiers + soldier pop supported regiment count)ranking
Diffstat (limited to 'src/openvic-simulation/map/State.cpp')
-rw-r--r--src/openvic-simulation/map/State.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/openvic-simulation/map/State.cpp b/src/openvic-simulation/map/State.cpp
index 90cbace..020b6f1 100644
--- a/src/openvic-simulation/map/State.cpp
+++ b/src/openvic-simulation/map/State.cpp
@@ -22,7 +22,8 @@ State::State(
provinces { std::move(new_provinces) },
colony_status { new_colony_status },
pop_type_distribution { &pop_type_keys },
- industrial_power { 0 } {}
+ industrial_power { 0 },
+ max_supported_regiments { 0 } {}
std::string State::get_identifier() const {
return StringUtils::append_string_views(
@@ -37,6 +38,7 @@ void State::update_gamestate() {
average_consciousness = 0;
average_militancy = 0;
pop_type_distribution.clear();
+ max_supported_regiments = 0;
for (ProvinceInstance const* province : provinces) {
total_population += province->get_total_population();
@@ -48,6 +50,8 @@ void State::update_gamestate() {
average_militancy += province->get_average_militancy() * province_population;
pop_type_distribution += province->get_pop_type_distribution();
+
+ max_supported_regiments += province->get_max_supported_regiments();
}
if (total_population > 0) {