aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/history/CountryHistory.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-07-23 19:47:47 +0200
committer GitHub <noreply@github.com>2024-07-23 19:47:47 +0200
commit6cd55c452d1643666ff4169a89402fd3e3b66c61 (patch)
tree888b847a54c66b6e9d1b2f7ee3e3d0f8071eceda /src/openvic-simulation/history/CountryHistory.cpp
parent9d57ca273e4b32ab82a51789ec58e08fefb5276a (diff)
parent67cbd14630c4344902d3fa1ddca178809da4293b (diff)
Merge pull request #177 from OpenVicProject/country-instance
Fleshing out Country, State and Province instances + history
Diffstat (limited to 'src/openvic-simulation/history/CountryHistory.cpp')
-rw-r--r--src/openvic-simulation/history/CountryHistory.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/openvic-simulation/history/CountryHistory.cpp b/src/openvic-simulation/history/CountryHistory.cpp
index 935a769..145d26b 100644
--- a/src/openvic-simulation/history/CountryHistory.cpp
+++ b/src/openvic-simulation/history/CountryHistory.cpp
@@ -47,14 +47,7 @@ bool CountryHistoryMap::_load_history_entry(
" when it actually belongs to ", reform.get_reform_group(), " in history of ", entry.get_country()
);
}
- if (std::find(entry.reforms.begin(), entry.reforms.end(), &reform) != entry.reforms.end()) {
- Logger::error(
- "Redefinition of reform ", reform.get_identifier(), " in history of ", entry.get_country()
- );
- return false;
- }
- entry.reforms.push_back(&reform);
- return true;
+ return set_callback_pointer(entry.reforms)(reform);
})(value);
}
@@ -81,9 +74,7 @@ bool CountryHistoryMap::_load_history_entry(
),
"primary_culture", ZERO_OR_ONE,
culture_manager.expect_culture_identifier(assign_variable_callback_pointer_opt(entry.primary_culture)),
- "culture", ZERO_OR_MORE, culture_manager.expect_culture_identifier(
- vector_callback_pointer(entry.accepted_cultures)
- ),
+ "culture", ZERO_OR_MORE, culture_manager.expect_culture_identifier(set_callback_pointer(entry.accepted_cultures)),
"religion", ZERO_OR_ONE, definition_manager.get_pop_manager().get_religion_manager().expect_religion_identifier(
assign_variable_callback_pointer_opt(entry.religion)
),