aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/pop/Culture.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-10-12 21:19:00 +0200
committer hop311 <hop3114@gmail.com>2023-10-12 21:19:00 +0200
commite50c67eb1aaa54f5fb31425f81616bea4e6b880a (patch)
treec4fbc6ee494f8ad33a8de36be5fc300165ce05fc /src/openvic-simulation/pop/Culture.cpp
parentbb22324da1225a0ac458c1d69893bb3bd28bd6b7 (diff)
Lots of accumulated changes
Diffstat (limited to 'src/openvic-simulation/pop/Culture.cpp')
-rw-r--r--src/openvic-simulation/pop/Culture.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/openvic-simulation/pop/Culture.cpp b/src/openvic-simulation/pop/Culture.cpp
index 6285305..261ad4c 100644
--- a/src/openvic-simulation/pop/Culture.cpp
+++ b/src/openvic-simulation/pop/Culture.cpp
@@ -118,16 +118,12 @@ bool CultureManager::_load_culture_group(size_t& total_expected_cultures,
GraphicalCultureType const* unit_graphical_culture_type = default_unit_graphical_culture_type;
bool is_overseas = true;
- bool ret = expect_dictionary_keys_and_length(
- [&total_expected_cultures](size_t size) -> size_t {
- total_expected_cultures += size;
- return size;
- },
- ALLOW_OTHER_KEYS,
- "leader", ONE_EXACTLY, decrement_callback(total_expected_cultures, expect_identifier(assign_variable_callback(leader))),
- "unit", ZERO_OR_ONE, decrement_callback(total_expected_cultures, expect_graphical_culture_type_identifier(assign_variable_callback_pointer(unit_graphical_culture_type))),
- "union", ZERO_OR_ONE, decrement_callback(total_expected_cultures, success_callback),
- "is_overseas", ZERO_OR_ONE, decrement_callback(total_expected_cultures, expect_bool(assign_variable_callback(is_overseas)))
+ bool ret = expect_dictionary_keys_and_default(
+ increment_callback(total_expected_cultures),
+ "leader", ONE_EXACTLY, expect_identifier(assign_variable_callback(leader)),
+ "unit", ZERO_OR_ONE, expect_identifier(expect_graphical_culture_type_identifier(assign_variable_callback_pointer(unit_graphical_culture_type))),
+ "union", ZERO_OR_ONE, success_callback,
+ "is_overseas", ZERO_OR_ONE, expect_bool(assign_variable_callback(is_overseas))
)(culture_group_node);
ret &= add_culture_group(culture_group_key, leader, unit_graphical_culture_type, is_overseas);
return ret;