diff options
author | wvpm <24685035+wvpm@users.noreply.github.com> | 2024-01-12 21:53:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-12 21:53:46 +0100 |
commit | 7b5a960ee9fce4241f83e5217bcf8f43af99f330 (patch) | |
tree | 60101bdfe575a25c9ef10cdcc52691140795405d /src/openvic-simulation/politics/Rebel.cpp | |
parent | e79d3e0416e62883c697225b090d03abafc7bb30 (diff) | |
parent | 177a0051eceb657ad838048d9532e306e18ce4e5 (diff) |
Merge pull request #126 from OpenVicProject/improve_modifiers
Case insensitive modifiers & added more
Diffstat (limited to 'src/openvic-simulation/politics/Rebel.cpp')
-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; |