aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map/ProvinceInstance.hpp
diff options
context:
space:
mode:
author wvpm <24685035+wvpm@users.noreply.github.com>2024-09-22 10:48:18 +0200
committer wvpm <24685035+wvpm@users.noreply.github.com>2024-09-22 10:48:18 +0200
commitea9b695022d197d918f1bb4292a0f424018dad37 (patch)
tree15d46970d136b08da9adf53a86e54fa97675cab2 /src/openvic-simulation/map/ProvinceInstance.hpp
parent61ccb748627a3faeec282f53f746045d1a695517 (diff)
Map province history rgo to production type for province instance
Diffstat (limited to 'src/openvic-simulation/map/ProvinceInstance.hpp')
-rw-r--r--src/openvic-simulation/map/ProvinceInstance.hpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/openvic-simulation/map/ProvinceInstance.hpp b/src/openvic-simulation/map/ProvinceInstance.hpp
index fa0be98..9899a16 100644
--- a/src/openvic-simulation/map/ProvinceInstance.hpp
+++ b/src/openvic-simulation/map/ProvinceInstance.hpp
@@ -1,14 +1,18 @@
#pragma once
+#include <cstddef>
+
#include <plf_colony.h>
#include "openvic-simulation/economy/BuildingInstance.hpp"
+#include "openvic-simulation/economy/production/ProductionType.hpp"
#include "openvic-simulation/military/UnitInstance.hpp"
#include "openvic-simulation/military/UnitType.hpp"
#include "openvic-simulation/pop/Pop.hpp"
-#include "openvic-simulation/types/fixed_point/FixedPointMap.hpp"
#include "openvic-simulation/types/HasIdentifier.hpp"
#include "openvic-simulation/types/OrderedContainers.hpp"
+#include "openvic-simulation/types/fixed_point/FixedPointMap.hpp"
+
namespace OpenVic {
struct MapInstance;
@@ -70,8 +74,7 @@ namespace OpenVic {
bool PROPERTY(slave);
Crime const* PROPERTY_RW(crime);
- // TODO - change this into a factory-like structure
- GoodDefinition const* PROPERTY(rgo);
+ ProductionType const* PROPERTY_RW_ACCESS(rgo_production_type, public);
IdentifierRegistry<BuildingInstance> IDENTIFIER_REGISTRY(building);
ordered_set<ArmyInstance*> PROPERTY(armies);
ordered_set<NavyInstance*> PROPERTY(navies);
@@ -112,6 +115,14 @@ namespace OpenVic {
return controller;
}
+ GoodDefinition const* get_rgo_good() const {
+ GoodDefinition const* rgo_good { nullptr };
+ if(rgo_production_type != nullptr) {
+ rgo_good = rgo_production_type->get_output_good();
+ }
+ return rgo_good;
+ }
+
bool set_owner(CountryInstance* new_owner);
bool set_controller(CountryInstance* new_controller);
bool add_core(CountryInstance& new_core);
@@ -133,7 +144,7 @@ namespace OpenVic {
bool remove_unit_instance_group(UnitInstanceGroup<Branch>& group);
bool setup(BuildingTypeManager const& building_type_manager);
- bool apply_history_to_province(ProvinceHistoryEntry const& entry, CountryInstanceManager& country_manager);
+ bool apply_history_to_province(ProvinceHistoryEntry const& entry, CountryInstanceManager& country_manager, ProductionTypeManager const& production_type_manager);
void setup_pop_test_values(IssueManager const& issue_manager);
};