aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/openvic-simulation/map/ProvinceInstance.cpp25
-rw-r--r--src/openvic-simulation/map/ProvinceInstance.hpp2
2 files changed, 12 insertions, 15 deletions
diff --git a/src/openvic-simulation/map/ProvinceInstance.cpp b/src/openvic-simulation/map/ProvinceInstance.cpp
index 9e7fd6e..ffcdfa1 100644
--- a/src/openvic-simulation/map/ProvinceInstance.cpp
+++ b/src/openvic-simulation/map/ProvinceInstance.cpp
@@ -39,20 +39,17 @@ ProvinceInstance::ProvinceInstance(
religion_distribution {},
max_supported_regiments { 0 } {}
- GoodDefinition const* ProvinceInstance::get_rgo_good() const {
- if(rgo == nullptr) { return nullptr; }
- return rgo->get_production_type()->get_output_good();
- }
- void ProvinceInstance::set_rgo_production_type(ProductionType const& production_type) {
- if(production_type.get_template_type() != ProductionType::template_type_t::RGO) {
- //error
- }
-
- //recalculate rgo size?
- //convert pops farmers <> labourers
-
- rgo->set_production_type(&production_type);
- }
+GoodDefinition const* ProvinceInstance::get_rgo_good() const {
+ if(rgo == nullptr) { return nullptr; }
+ return rgo->get_production_type()->get_output_good();
+}
+void ProvinceInstance::set_rgo_production_type(ProductionType const& rgo_production_type) {
+ if(rgo_production_type.get_template_type() != ProductionType::template_type_t::RGO) {
+ //error
+ }
+ convert_rgo_worker_pops_to_equivalent(rgo_production_type);
+ rgo->set_production_type(&rgo_production_type);
+}
bool ProvinceInstance::set_owner(CountryInstance* new_owner) {
bool ret = true;
diff --git a/src/openvic-simulation/map/ProvinceInstance.hpp b/src/openvic-simulation/map/ProvinceInstance.hpp
index c8168a9..f1d4b75 100644
--- a/src/openvic-simulation/map/ProvinceInstance.hpp
+++ b/src/openvic-simulation/map/ProvinceInstance.hpp
@@ -120,7 +120,7 @@ namespace OpenVic {
}
GoodDefinition const* get_rgo_good() const;
- void set_rgo_production_type(ProductionType const& production_type);
+ void set_rgo_production_type(ProductionType const& rgo_production_type);
bool set_owner(CountryInstance* new_owner);
bool set_controller(CountryInstance* new_controller);