aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/military/LeaderTrait.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-10-20 20:44:51 +0200
committer GitHub <noreply@github.com>2024-10-20 20:44:51 +0200
commit6527f832a5e14a28fc1f5b85628541038eb90141 (patch)
treeaca829171be7b1144cb3ca29510593fa8a84af24 /src/openvic-simulation/military/LeaderTrait.cpp
parent9a84e7af70f2528578b00879e568bca285563e9b (diff)
parent5194a3d043db66b81470111a94f3b1cdf8d42176 (diff)
Merge pull request #198 from OpenVicProject/resultant-modifier
Calculate country and province modifier sums
Diffstat (limited to 'src/openvic-simulation/military/LeaderTrait.cpp')
-rw-r--r--src/openvic-simulation/military/LeaderTrait.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/openvic-simulation/military/LeaderTrait.cpp b/src/openvic-simulation/military/LeaderTrait.cpp
index da7331a..7835636 100644
--- a/src/openvic-simulation/military/LeaderTrait.cpp
+++ b/src/openvic-simulation/military/LeaderTrait.cpp
@@ -1,5 +1,7 @@
#include "LeaderTrait.hpp"
+#include "openvic-simulation/modifier/ModifierManager.hpp"
+
using namespace OpenVic;
using namespace OpenVic::NodeTools;
@@ -30,17 +32,21 @@ bool LeaderTraitManager::load_leader_traits_file(ModifierManager const& modifier
return expect_dictionary_reserve_length(
leader_traits,
[this, &modifier_manager, type](std::string_view trait_identifier, ast::NodeCPtr value) -> bool {
+ using enum Modifier::modifier_type_t;
+
static const string_set_t allowed_modifiers = {
- "attack", "defence", "morale", "organisation", "reconnaissance",
+ "attack", "defence leader", "morale", "organisation", "reconnaissance",
"speed", "attrition", "experience", "reliability"
};
ModifierValue modifiers;
+
bool ret = modifier_manager.expect_whitelisted_modifier_value(
- move_variable_callback(modifiers), allowed_modifiers
+ move_variable_callback(modifiers), LEADER, allowed_modifiers
)(value);
ret &= add_leader_trait(trait_identifier, type, std::move(modifiers));
+
return ret;
}
);