diff options
Diffstat (limited to 'src/openvic-simulation/modifier/ModifierSum.cpp')
-rw-r--r-- | src/openvic-simulation/modifier/ModifierSum.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/openvic-simulation/modifier/ModifierSum.cpp b/src/openvic-simulation/modifier/ModifierSum.cpp index 312432a..4051d64 100644 --- a/src/openvic-simulation/modifier/ModifierSum.cpp +++ b/src/openvic-simulation/modifier/ModifierSum.cpp @@ -15,6 +15,10 @@ fixed_point_t ModifierSum::get_effect(ModifierEffect const& effect, bool* effect return value_sum.get_effect(effect, effect_found); } +fixed_point_t ModifierSum::get_effect_nullcheck(ModifierEffect const* effect, bool* effect_found) const { + return value_sum.get_effect_nullcheck(effect, effect_found); +} + bool ModifierSum::has_effect(ModifierEffect const& effect) const { return value_sum.has_effect(effect); } @@ -30,6 +34,14 @@ void ModifierSum::add_modifier( } } +void ModifierSum::add_modifier_nullcheck( + Modifier const* modifier, modifier_source_t const& source, fixed_point_t multiplier, ModifierEffect::target_t targets +) { + if (modifier != nullptr) { + add_modifier(*modifier, source, multiplier, targets); + } +} + void ModifierSum::add_modifier_sum(ModifierSum const& modifier_sum) { modifiers.insert(modifiers.end(), modifier_sum.modifiers.begin(), modifier_sum.modifiers.end()); value_sum += modifier_sum.value_sum; |