aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/pop
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-simulation/pop')
-rw-r--r--src/openvic-simulation/pop/Pop.cpp25
-rw-r--r--src/openvic-simulation/pop/Pop.hpp4
2 files changed, 1 insertions, 28 deletions
diff --git a/src/openvic-simulation/pop/Pop.cpp b/src/openvic-simulation/pop/Pop.cpp
index cf54c2b..eae2e52 100644
--- a/src/openvic-simulation/pop/Pop.cpp
+++ b/src/openvic-simulation/pop/Pop.cpp
@@ -156,28 +156,3 @@ bool PopManager::load_pop_type_file(
);
return ret;
}
-
-bool PopManager::load_pop_into_province(Province& province, std::string_view pop_type_identifier, ast::NodeCPtr pop_node)
- const {
- PopType const* type = get_pop_type_by_identifier(pop_type_identifier);
- Culture const* culture = nullptr;
- Religion const* religion = nullptr;
- Pop::pop_size_t size = 0;
- bool ret = expect_dictionary_keys(
- "culture", ONE_EXACTLY, culture_manager.expect_culture_identifier(assign_variable_callback_pointer(culture)),
- "religion", ONE_EXACTLY, religion_manager.expect_religion_identifier(assign_variable_callback_pointer(religion)),
- "size", ONE_EXACTLY, expect_uint(assign_variable_callback(size)),
- "militancy", ZERO_OR_ONE, success_callback,
- "rebel_type", ZERO_OR_ONE, success_callback
- )(pop_node);
-
- if (type != nullptr && culture != nullptr && religion != nullptr && size > 0) {
- ret &= province.add_pop({ *type, *culture, *religion, size });
- } else {
- Logger::warning(
- "Some pop arguments are invalid: province = ", province, ", type = ", type, ", culture = ", culture,
- ", religion = ", religion, ", size = ", size
- );
- }
- return ret;
-}
diff --git a/src/openvic-simulation/pop/Pop.hpp b/src/openvic-simulation/pop/Pop.hpp
index 736b77d..12daaf6 100644
--- a/src/openvic-simulation/pop/Pop.hpp
+++ b/src/openvic-simulation/pop/Pop.hpp
@@ -27,9 +27,8 @@ namespace OpenVic {
pop_size_t PROPERTY(num_demoted);
pop_size_t PROPERTY(num_migrated);
- Pop(PopType const& new_type, Culture const& new_culture, Religion const& new_religion, pop_size_t new_size);
-
public:
+ Pop(PopType const& new_type, Culture const& new_culture, Religion const& new_religion, pop_size_t new_size);
Pop(Pop const&) = delete;
Pop(Pop&&) = default;
Pop& operator=(Pop const&) = delete;
@@ -111,6 +110,5 @@ namespace OpenVic {
bool load_pop_type_file(
std::string_view filestem, UnitManager const& unit_manager, GoodManager const& good_manager, ast::NodeCPtr root
);
- bool load_pop_into_province(Province& province, std::string_view pop_type_identifier, ast::NodeCPtr pop_node) const;
};
}