diff options
author | hop311 <hop3114@gmail.com> | 2024-10-05 20:08:55 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-10-05 22:48:42 +0200 |
commit | 6c23b7ff2e8bc733699ef9b29aee80719001acf2 (patch) | |
tree | 31032796ff2addd154837a873663d8325ee6bdc6 /src/openvic-simulation/modifier/ModifierSum.hpp | |
parent | 4f9fd8a327b6de5fb32792a07453e9a2e245dc84 (diff) |
Add nullcheck fuction variants accepting pointer arguments to ModifierValue and ModifierSum
Diffstat (limited to 'src/openvic-simulation/modifier/ModifierSum.hpp')
-rw-r--r-- | src/openvic-simulation/modifier/ModifierSum.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/openvic-simulation/modifier/ModifierSum.hpp b/src/openvic-simulation/modifier/ModifierSum.hpp index b982ed1..406c52b 100644 --- a/src/openvic-simulation/modifier/ModifierSum.hpp +++ b/src/openvic-simulation/modifier/ModifierSum.hpp @@ -39,12 +39,17 @@ namespace OpenVic { bool empty(); fixed_point_t get_effect(ModifierEffect const& effect, bool* effect_found = nullptr) const; + fixed_point_t get_effect_nullcheck(ModifierEffect const* effect, bool* effect_found = nullptr) const; bool has_effect(ModifierEffect const& effect) const; void add_modifier( Modifier const& modifier, modifier_source_t const& source, fixed_point_t multiplier = fixed_point_t::_1(), ModifierEffect::target_t targets = ModifierEffect::target_t::ALL_TARGETS ); + void add_modifier_nullcheck( + Modifier const* modifier, modifier_source_t const& source, fixed_point_t multiplier = fixed_point_t::_1(), + ModifierEffect::target_t targets = ModifierEffect::target_t::ALL_TARGETS + ); void add_modifier_sum(ModifierSum const& modifier_sum); void add_modifier_sum_filter_targets(ModifierSum const& modifier_sum, ModifierEffect::target_t targets); void add_modifier_sum_exclude_source(ModifierSum const& modifier_sum, modifier_source_t const& excluded_source); |