From 1e40569a49ab0d557a2a43ee900f4f28d5c81cd3 Mon Sep 17 00:00:00 2001 From: Hop311 Date: Thu, 28 Sep 2023 23:33:46 +0100 Subject: Data types, defaults, callback cleanup --- src/openvic-simulation/pop/Pop.cpp | 8 ++++---- src/openvic-simulation/pop/Religion.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/openvic-simulation/pop') diff --git a/src/openvic-simulation/pop/Pop.cpp b/src/openvic-simulation/pop/Pop.cpp index 17bacbf..38cd883 100644 --- a/src/openvic-simulation/pop/Pop.cpp +++ b/src/openvic-simulation/pop/Pop.cpp @@ -152,11 +152,11 @@ bool PopManager::load_pop_type_file(std::string_view filestem, ast::NodeCPtr roo bool state_capital_only = false, is_artisan = false, is_slave = false, demote_migrant = false; Pop::pop_size_t max_size = 0, merge_max_size = 0; bool ret = expect_dictionary_keys( - "sprite", ONE_EXACTLY, expect_uint(assign_variable_callback_uint("poptype sprite", sprite)), + "sprite", ONE_EXACTLY, expect_uint(assign_variable_callback_uint(sprite)), "color", ONE_EXACTLY, expect_colour(assign_variable_callback(colour)), "is_artisan", ZERO_OR_ONE, expect_bool(assign_variable_callback(is_artisan)), - "max_size", ZERO_OR_ONE, expect_uint(assign_variable_callback_uint("poptype max_size", max_size)), - "merge_max_size", ZERO_OR_ONE, expect_uint(assign_variable_callback_uint("poptype merge_max_size", merge_max_size)), + "max_size", ZERO_OR_ONE, expect_uint(assign_variable_callback_uint(max_size)), + "merge_max_size", ZERO_OR_ONE, expect_uint(assign_variable_callback_uint(merge_max_size)), "strata", ONE_EXACTLY, expect_identifier( [&strata](std::string_view identifier) -> bool { using strata_map_t = std::map>; @@ -218,7 +218,7 @@ bool PopManager::load_pop_into_province(Province& province, std::string_view pop 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_uint("pop size", size)), + "size", ONE_EXACTLY, expect_uint(assign_variable_callback_uint(size)), "militancy", ZERO_OR_ONE, success_callback, "rebel_type", ZERO_OR_ONE, success_callback )(pop_node); diff --git a/src/openvic-simulation/pop/Religion.cpp b/src/openvic-simulation/pop/Religion.cpp index c679e00..32a3219 100644 --- a/src/openvic-simulation/pop/Religion.cpp +++ b/src/openvic-simulation/pop/Religion.cpp @@ -91,7 +91,7 @@ bool ReligionManager::load_religion_file(ast::NodeCPtr root) { bool pagan = false; bool ret = expect_dictionary_keys( - "icon", ONE_EXACTLY, expect_uint(assign_variable_callback_uint("religion icon", icon)), + "icon", ONE_EXACTLY, expect_uint(assign_variable_callback_uint(icon)), "color", ONE_EXACTLY, expect_colour(assign_variable_callback(colour)), "pagan", ZERO_OR_ONE, expect_bool(assign_variable_callback(pagan)) )(value); -- cgit v1.2.3-56-ga3b1