4242#include " openvic-simulation/types/Date.hpp"
4343#include " openvic-simulation/types/fixed_point/FixedPoint.hpp"
4444#include " openvic-simulation/types/IndexedFlatMap.hpp"
45- #include " openvic-simulation/types/PopSize.hpp"
45+ #include " openvic-simulation/population/PopSize.hpp"
46+ #include " openvic-simulation/population/PopSum.hpp"
4647#include " openvic-simulation/types/UnitBranchType.hpp"
4748#include " openvic-simulation/utility/Containers.hpp"
4849#include " openvic-simulation/utility/Logger.hpp"
@@ -1340,8 +1341,8 @@ void CountryInstance::_update_budget() {
13401341 OpenVic immediately updates both.
13411342 */
13421343
1343- pop_size_t total_non_colonial_population = 0 ;
1344- pop_size_t administrators = 0 ;
1344+ pop_sum_t total_non_colonial_population = 0 ;
1345+ pop_sum_t administrators = 0 ;
13451346 for (State const * const state_ptr : states) {
13461347 if (state_ptr == nullptr ) {
13471348 continue ;
@@ -1352,7 +1353,7 @@ void CountryInstance::_update_budget() {
13521353 continue ;
13531354 }
13541355
1355- IndexedFlatMap<PopType, pop_size_t > const & state_population_by_type = state.get_population_by_type ();
1356+ IndexedFlatMap<PopType, pop_sum_t > const & state_population_by_type = state.get_population_by_type ();
13561357
13571358 for (auto const & [pop_type, size] : state_population_by_type) {
13581359 if (pop_type.is_administrator ) {
@@ -1365,13 +1366,13 @@ void CountryInstance::_update_budget() {
13651366 if (total_non_colonial_population == 0 ) {
13661367 administrative_efficiency_from_administrators.set (fixed_point_t ::_1);
13671368 administrator_percentage.set (fixed_point_t ::_0);
1368- } else {
1369- administrator_percentage.set (fixed_point_t::parse (administrators) / total_non_colonial_population);
1369+ } else {
1370+ administrator_percentage.set (fixed_point_t::parse (type_safe::get ( administrators)) / type_safe::get ( total_non_colonial_population) );
13701371
1371- const fixed_point_t desired_administrators = desired_administrator_percentage.get_untracked () * total_non_colonial_population;
1372+ const fixed_point_t desired_administrators = desired_administrator_percentage.get_untracked () * type_safe::get ( total_non_colonial_population) ;
13721373 const fixed_point_t administrative_efficiency_from_administrators_unclamped = std::min (
13731374 fixed_point_t::mul_div (
1374- administrators,
1375+ type_safe::get ( administrators) ,
13751376 fixed_point_t ::_1 + get_modifier_effect_value (*modifier_effect_cache.get_administrative_efficiency ()),
13761377 desired_administrators
13771378 )
@@ -1397,7 +1398,7 @@ void CountryInstance::_update_budget() {
13971398 projected_education_spending_unscaled_by_slider_running_total += size * education_salary_base_by_pop_type.at (pop_type).get_untracked ();
13981399 projected_military_spending_unscaled_by_slider_running_total += size * military_salary_base_by_pop_type.at (pop_type).get_untracked ();
13991400 projected_pensions_spending_unscaled_by_slider_running_total += size * calculate_pensions_base (pop_type);
1400- projected_unemployment_subsidies_spending_unscaled_by_slider_running_total += get_unemployed_pops_by_type (pop_type)
1401+ projected_unemployment_subsidies_spending_unscaled_by_slider_running_total += type_safe::get ( get_unemployed_pops_by_type (pop_type) )
14011402 * calculate_unemployment_subsidies_base (pop_type);
14021403 }
14031404
0 commit comments