aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/research/Technology.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-10-19 12:39:08 +0200
committer hop311 <hop3114@gmail.com>2024-10-19 12:39:08 +0200
commit572ac597d8b43c4c97be4b68aa40de0e7ae6bfe0 (patch)
treec529d60fe49fbcd167522c0fb21ca10139cb5cc7 /src/openvic-simulation/research/Technology.cpp
parent35909d6e79d524f19f9b69dffd02fcf162be5093 (diff)
Require modifier type when parsing ModifierValues
Diffstat (limited to 'src/openvic-simulation/research/Technology.cpp')
-rw-r--r--src/openvic-simulation/research/Technology.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/openvic-simulation/research/Technology.cpp b/src/openvic-simulation/research/Technology.cpp
index 773b3c6..a770a40 100644
--- a/src/openvic-simulation/research/Technology.cpp
+++ b/src/openvic-simulation/research/Technology.cpp
@@ -142,8 +142,13 @@ bool TechnologyManager::load_technology_file_schools(
const bool ret = expect_dictionary_reserve_length(
technology_schools,
[this, &modifier_manager](std::string_view school_key, ast::NodeCPtr school_value) -> bool {
+ using enum Modifier::modifier_type_t;
+
ModifierValue modifiers;
- bool ret = modifier_manager.expect_modifier_value(move_variable_callback(modifiers))(school_value);
+
+ bool ret = modifier_manager.expect_modifier_value(
+ move_variable_callback(modifiers), TECH_SCHOOL
+ )(school_value);
ret &= add_technology_school(school_key, std::move(modifiers));
@@ -165,6 +170,8 @@ bool TechnologyManager::load_technologies_file(
return expect_dictionary_reserve_length(technologies, [this, &modifier_manager, &unit_type_manager, &building_type_manager](
std::string_view tech_key, ast::NodeCPtr tech_value
) -> bool {
+ using enum Modifier::modifier_type_t;
+
ModifierValue modifiers;
TechnologyArea const* area = nullptr;
Date::year_t year = 0;
@@ -177,6 +184,7 @@ bool TechnologyManager::load_technologies_file(
bool ret = modifier_manager.expect_modifier_value_and_keys(
move_variable_callback(modifiers),
+ TECHNOLOGY,
"area", ONE_EXACTLY, expect_technology_area_identifier(assign_variable_callback_pointer(area)),
"year", ONE_EXACTLY, expect_uint(assign_variable_callback(year)),
"cost", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(cost)),