diff options
Diffstat (limited to 'src/openvic-simulation/map')
-rw-r--r-- | src/openvic-simulation/map/ProvinceInstance.cpp | 26 | ||||
-rw-r--r-- | src/openvic-simulation/map/ProvinceInstance.hpp | 3 |
2 files changed, 1 insertions, 28 deletions
diff --git a/src/openvic-simulation/map/ProvinceInstance.cpp b/src/openvic-simulation/map/ProvinceInstance.cpp index 7abb5cb..4282e7b 100644 --- a/src/openvic-simulation/map/ProvinceInstance.cpp +++ b/src/openvic-simulation/map/ProvinceInstance.cpp @@ -9,7 +9,6 @@ #include "openvic-simulation/misc/Define.hpp" #include "openvic-simulation/politics/Ideology.hpp" #include "openvic-simulation/pop/Pop.hpp" -#include "openvic-simulation/types/fixed_point/FixedPoint.hpp" using namespace OpenVic; @@ -201,29 +200,6 @@ void ProvinceInstance::_update_pops(DefineManager const& define_manager) { } } -fixed_point_t ProvinceInstance::calculate_rgo_size(ProductionType const& production_type) const { - std::vector<Job> const& jobs = production_type.get_jobs(); - fixed_point_t total_worker_count_in_province = 0; //not counting equivalents - for(Pop const& pop : pops) { - bool is_worker_pop_type = false; - for(Job const& job : jobs) { - if(job.get_pop_type() == pop.get_type()) { - is_worker_pop_type = true; - break; - } - } - - if(is_worker_pop_type) { - total_worker_count_in_province += pop.get_size(); - } - } - - const fixed_point_t base_workforce_size = production_type.get_base_workforce_size(); - //TODO: if is_farm add farm size bonus - //TODO: if is_mine add mine size bonus - return ((total_worker_count_in_province / base_workforce_size).ceil() * fixed_point_t::_1_50()).floor(); -} - void ProvinceInstance::convert_rgo_worker_pops_to_equivalent(ProductionType const& production_type) { std::vector<Job> const& jobs = production_type.get_jobs(); fixed_point_t total_worker_count_in_province = 0; //not counting equivalents @@ -362,8 +338,8 @@ bool ProvinceInstance::apply_history_to_province(ProvinceHistoryEntry const& ent void ProvinceInstance::setup_rgo(ProductionType const& rgo_production_type) { convert_rgo_worker_pops_to_equivalent(rgo_production_type); - rgo.set_size_multiplier(calculate_rgo_size(rgo_production_type)); rgo.set_production_type(&rgo_production_type); + rgo.update_size(*this); } void ProvinceInstance::setup_pop_test_values(IssueManager const& issue_manager) { diff --git a/src/openvic-simulation/map/ProvinceInstance.hpp b/src/openvic-simulation/map/ProvinceInstance.hpp index 281f19f..7e2754f 100644 --- a/src/openvic-simulation/map/ProvinceInstance.hpp +++ b/src/openvic-simulation/map/ProvinceInstance.hpp @@ -9,8 +9,6 @@ #include "openvic-simulation/pop/Pop.hpp" #include "openvic-simulation/types/HasIdentifier.hpp" #include "openvic-simulation/types/OrderedContainers.hpp" -#include "openvic-simulation/types/fixed_point/FixedPointMap.hpp" -#include "openvic-simulation/types/fixed_point/FixedPoint.hpp" namespace OpenVic { @@ -99,7 +97,6 @@ namespace OpenVic { void _add_pop(Pop&& pop); void _update_pops(DefineManager const& define_manager); - fixed_point_t calculate_rgo_size(ProductionType const& production_type) const; void convert_rgo_worker_pops_to_equivalent(ProductionType const& production_type); public: |