diff options
author | wvpm <24685035+wvpm@users.noreply.github.com> | 2024-01-10 21:12:43 +0100 |
---|---|---|
committer | wvpm <24685035+wvpm@users.noreply.github.com> | 2024-01-12 21:35:39 +0100 |
commit | 177a0051eceb657ad838048d9532e306e18ce4e5 (patch) | |
tree | 60101bdfe575a25c9ef10cdcc52691140795405d /src/openvic-simulation/politics | |
parent | e79d3e0416e62883c697225b090d03abafc7bb30 (diff) |
Case insensitive modifiers & added more
Diffstat (limited to 'src/openvic-simulation/politics')
-rw-r--r-- | src/openvic-simulation/politics/Rebel.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/openvic-simulation/politics/Rebel.cpp b/src/openvic-simulation/politics/Rebel.cpp index f86bb51..4bf5ecb 100644 --- a/src/openvic-simulation/politics/Rebel.cpp +++ b/src/openvic-simulation/politics/Rebel.cpp @@ -1,5 +1,10 @@ #include "Rebel.hpp" +#include <string_view> + +#include "openvic-simulation/misc/Modifier.hpp" + + using namespace OpenVic; using namespace OpenVic::NodeTools; @@ -172,14 +177,15 @@ bool RebelManager::load_rebels_file( bool RebelManager::generate_modifiers(ModifierManager& modifier_manager) const { bool ret = true; + static constexpr std::string_view identifier = "rebel_org_gain"; + static constexpr bool is_positive_good = false; + ret &= modifier_manager.register_complex_modifier(identifier); - ret &= modifier_manager.register_complex_modifier("rebel_org_gain"); - - ret &= modifier_manager.add_modifier_effect("rebel_org_gain_all", false); + ret &= modifier_manager.add_modifier_effect(ModifierManager::get_flat_identifier(identifier, "all"), is_positive_good); for (RebelType const& rebel_type : get_rebel_types()) { ret &= modifier_manager.add_modifier_effect( - StringUtils::append_string_views("rebel_org_gain_", rebel_type.get_identifier()), false + ModifierManager::get_flat_identifier(identifier, rebel_type.get_identifier()), is_positive_good ); } return ret; |