aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation
diff options
context:
space:
mode:
author wvpm <24685035+wvpm@users.noreply.github.com>2024-09-22 20:51:01 +0200
committer wvpm <24685035+wvpm@users.noreply.github.com>2024-09-22 20:51:01 +0200
commite966b91c3f3798acc42a4134569c2ac636723b4c (patch)
treed0207a84e8a1a2219a81b07e9cff9db013d267a6 /src/openvic-simulation
parent873229df9f38ff19eb23018fd522bb313e511085 (diff)
ProductionType const& output_good
Diffstat (limited to 'src/openvic-simulation')
-rw-r--r--src/openvic-simulation/economy/production/ProductionType.cpp4
-rw-r--r--src/openvic-simulation/economy/production/ProductionType.hpp4
-rw-r--r--src/openvic-simulation/map/ProvinceInstance.cpp2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/openvic-simulation/economy/production/ProductionType.cpp b/src/openvic-simulation/economy/production/ProductionType.cpp
index 5889986..8bf82e8 100644
--- a/src/openvic-simulation/economy/production/ProductionType.cpp
+++ b/src/openvic-simulation/economy/production/ProductionType.cpp
@@ -22,7 +22,7 @@ ProductionType::ProductionType(
template_type_t new_template_type,
Pop::pop_size_t new_base_workforce_size,
GoodDefinition::good_definition_map_t&& new_input_goods,
- GoodDefinition const* new_output_good,
+ GoodDefinition const& new_output_good,
fixed_point_t new_base_output_quantity,
std::vector<bonus_t>&& new_bonuses,
GoodDefinition::good_definition_map_t&& new_maintenance_requirements,
@@ -169,7 +169,7 @@ bool ProductionTypeManager::add_production_type(
}
const bool ret = production_types.add_item({
- identifier, owner, std::move(jobs), template_type, base_workforce_size, std::move(input_goods), output_good,
+ identifier, owner, std::move(jobs), template_type, base_workforce_size, std::move(input_goods), *output_good,
base_output_quantity, std::move(bonuses), std::move(maintenance_requirements), is_coastal, is_farm, is_mine
});
diff --git a/src/openvic-simulation/economy/production/ProductionType.hpp b/src/openvic-simulation/economy/production/ProductionType.hpp
index b06c9b5..790872b 100644
--- a/src/openvic-simulation/economy/production/ProductionType.hpp
+++ b/src/openvic-simulation/economy/production/ProductionType.hpp
@@ -47,7 +47,7 @@ namespace OpenVic {
const Pop::pop_size_t PROPERTY(base_workforce_size);
GoodDefinition::good_definition_map_t PROPERTY(input_goods);
- GoodDefinition const* PROPERTY(output_good);
+ GoodDefinition const& PROPERTY(output_good);
const fixed_point_t PROPERTY(base_output_quantity);
std::vector<bonus_t> PROPERTY(bonuses);
@@ -64,7 +64,7 @@ namespace OpenVic {
template_type_t new_template_type,
Pop::pop_size_t new_base_workforce_size,
GoodDefinition::good_definition_map_t&& new_input_goods,
- GoodDefinition const* new_output_goods,
+ GoodDefinition const& new_output_goods,
fixed_point_t new_base_output_quantity,
std::vector<bonus_t>&& new_bonuses,
GoodDefinition::good_definition_map_t&& new_maintenance_requirements,
diff --git a/src/openvic-simulation/map/ProvinceInstance.cpp b/src/openvic-simulation/map/ProvinceInstance.cpp
index e8361da..4efcfee 100644
--- a/src/openvic-simulation/map/ProvinceInstance.cpp
+++ b/src/openvic-simulation/map/ProvinceInstance.cpp
@@ -42,7 +42,7 @@ ProvinceInstance::ProvinceInstance(
GoodDefinition const* ProvinceInstance::get_rgo_good() const {
if(!rgo.is_valid()) { return nullptr; }
- return rgo.get_production_type()->get_output_good();
+ 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) {