aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/pop/Culture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-simulation/pop/Culture.cpp')
-rw-r--r--src/openvic-simulation/pop/Culture.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/openvic-simulation/pop/Culture.cpp b/src/openvic-simulation/pop/Culture.cpp
index 85c96a0..ebac344 100644
--- a/src/openvic-simulation/pop/Culture.cpp
+++ b/src/openvic-simulation/pop/Culture.cpp
@@ -57,7 +57,8 @@ bool CultureManager::add_graphical_culture_type(std::string_view identifier) {
return graphical_culture_types.add_item({ identifier });
}
-bool CultureManager::add_culture_group(std::string_view identifier, std::string_view leader, GraphicalCultureType const* graphical_culture_type, bool is_overseas) {
+bool CultureManager::add_culture_group(std::string_view identifier, std::string_view leader,
+ GraphicalCultureType const* graphical_culture_type, bool is_overseas) {
if (!graphical_culture_types.is_locked()) {
Logger::error("Cannot register culture groups until graphical culture types are locked!");
return false;
@@ -77,7 +78,8 @@ bool CultureManager::add_culture_group(std::string_view identifier, std::string_
return culture_groups.add_item({ identifier, leader, *graphical_culture_type, is_overseas });
}
-bool CultureManager::add_culture(std::string_view identifier, colour_t colour, CultureGroup const* group, std::vector<std::string>&& first_names, std::vector<std::string>&& last_names) {
+bool CultureManager::add_culture(std::string_view identifier, colour_t colour, CultureGroup const* group,
+ std::vector<std::string>&& first_names, std::vector<std::string>&& last_names) {
if (!culture_groups.is_locked()) {
Logger::error("Cannot register cultures until culture groups are locked!");
return false;
@@ -119,7 +121,8 @@ bool CultureManager::_load_culture_group(size_t& total_expected_cultures,
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_graphical_culture_type_identifier(assign_variable_callback_pointer(unit_graphical_culture_type)),
+ "unit", ZERO_OR_ONE,
+ 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);
@@ -171,7 +174,8 @@ bool CultureManager::load_culture_file(ast::NodeCPtr root) {
}
static const std::string default_unit_graphical_culture_type_identifier = "Generic";
- GraphicalCultureType const* const default_unit_graphical_culture_type = get_graphical_culture_type_by_identifier(default_unit_graphical_culture_type_identifier);
+ GraphicalCultureType const* const default_unit_graphical_culture_type =
+ get_graphical_culture_type_by_identifier(default_unit_graphical_culture_type_identifier);
if (default_unit_graphical_culture_type == nullptr) {
Logger::error("Failed to find default unit graphical culture type: ", default_unit_graphical_culture_type_identifier);
}
@@ -179,7 +183,8 @@ bool CultureManager::load_culture_file(ast::NodeCPtr root) {
size_t total_expected_cultures = 0;
bool ret = expect_dictionary_reserve_length(
culture_groups,
- [this, default_unit_graphical_culture_type, &total_expected_cultures](std::string_view key, ast::NodeCPtr value) -> bool {
+ [this, default_unit_graphical_culture_type, &total_expected_cultures](
+ std::string_view key, ast::NodeCPtr value) -> bool {
return _load_culture_group(total_expected_cultures, default_unit_graphical_culture_type, key, value);
}
)(root);