aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/modifier/ModifierEffect.hpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-10-19 12:31:40 +0200
committer hop311 <hop3114@gmail.com>2024-10-19 12:31:40 +0200
commit35909d6e79d524f19f9b69dffd02fcf162be5093 (patch)
treefff57526931ab126e1250457e7ccc07c793504f4 /src/openvic-simulation/modifier/ModifierEffect.hpp
parent18ab144ec4ecf1efca68a26bc79b9d54e28e54f8 (diff)
Switch to excluding given modifier effect targets rather than using a positive filter
Diffstat (limited to 'src/openvic-simulation/modifier/ModifierEffect.hpp')
-rw-r--r--src/openvic-simulation/modifier/ModifierEffect.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/openvic-simulation/modifier/ModifierEffect.hpp b/src/openvic-simulation/modifier/ModifierEffect.hpp
index 8eac65b..ff82acf 100644
--- a/src/openvic-simulation/modifier/ModifierEffect.hpp
+++ b/src/openvic-simulation/modifier/ModifierEffect.hpp
@@ -27,6 +27,10 @@ namespace OpenVic {
ALL_TARGETS = (1 << 3) - 1
};
+ static constexpr bool excludes_targets(target_t targets, target_t excluded_target);
+
+ static std::string target_to_string(target_t target);
+
static std::string make_default_modifier_effect_localisation_key(std::string_view identifier);
private:
@@ -50,4 +54,10 @@ namespace OpenVic {
};
template<> struct enable_bitfield<ModifierEffect::target_t> : std::true_type {};
+
+ constexpr bool ModifierEffect::excludes_targets(target_t targets, target_t excluded_targets) {
+ using enum target_t;
+
+ return (targets & excluded_targets) == NO_TARGETS;
+ }
}