diff options
author | BrickPi <49528459+BrickPi@users.noreply.github.com> | 2023-10-17 05:42:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-17 05:42:13 +0200 |
commit | f85a0880e19c0ca75eea80f8f38c1e061269dd08 (patch) | |
tree | 8626fd196a411a8d14205d5232ce88e64f91b336 /src/openvic-simulation/Modifier.hpp | |
parent | e65646f260360f634cc7d4ff28e7676c766ebcd8 (diff) | |
parent | 3f59ead985c5598eee74423139a4789ebca57e13 (diff) |
Merge pull request #57 from OpenVicProject/modifier-effects
Diffstat (limited to 'src/openvic-simulation/Modifier.hpp')
-rw-r--r-- | src/openvic-simulation/Modifier.hpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/openvic-simulation/Modifier.hpp b/src/openvic-simulation/Modifier.hpp index 0801aa5..c6b15a6 100644 --- a/src/openvic-simulation/Modifier.hpp +++ b/src/openvic-simulation/Modifier.hpp @@ -11,7 +11,9 @@ namespace OpenVic { friend struct ModifierManager; enum class format_t { - RAW_DECIMAL, PERCENTAGE_DECIMAL, INT + RAW_DECIMAL, + PERCENTAGE_DECIMAL, + INT }; private: @@ -36,6 +38,7 @@ namespace OpenVic { friend struct ModifierManager; using effect_map_t = decimal_map_t<ModifierEffect const*>; + private: effect_map_t values; @@ -104,9 +107,7 @@ namespace OpenVic { IdentifierRegistry<Modifier> modifiers; /* effect_validator takes in ModifierEffect const& */ - NodeTools::key_value_callback_t _modifier_effect_callback(ModifierValue& modifier, - NodeTools::key_value_callback_t default_callback, - ModifierEffectValidator auto effect_validator) const; + NodeTools::key_value_callback_t _modifier_effect_callback(ModifierValue& modifier, NodeTools::key_value_callback_t default_callback, ModifierEffectValidator auto effect_validator) const; public: ModifierManager(); @@ -119,10 +120,8 @@ namespace OpenVic { bool setup_modifier_effects(); - NodeTools::node_callback_t expect_validated_modifier_value_and_default(NodeTools::callback_t<ModifierValue&&> modifier_callback, - NodeTools::key_value_callback_t default_callback, ModifierEffectValidator auto effect_validator) const; - NodeTools::node_callback_t expect_validated_modifier_value(NodeTools::callback_t<ModifierValue&&> modifier_callback, - ModifierEffectValidator auto effect_validator) const; + NodeTools::node_callback_t expect_validated_modifier_value_and_default(NodeTools::callback_t<ModifierValue&&> modifier_callback, NodeTools::key_value_callback_t default_callback, ModifierEffectValidator auto effect_validator) const; + NodeTools::node_callback_t expect_validated_modifier_value(NodeTools::callback_t<ModifierValue&&> modifier_callback, ModifierEffectValidator auto effect_validator) const; NodeTools::node_callback_t expect_modifier_value_and_default(NodeTools::callback_t<ModifierValue&&> modifier_callback, NodeTools::key_value_callback_t default_callback) const; NodeTools::node_callback_t expect_modifier_value(NodeTools::callback_t<ModifierValue&&> modifier_callback) const; @@ -134,8 +133,7 @@ namespace OpenVic { NodeTools::node_callback_t expect_modifier_value_and_key_map(NodeTools::callback_t<ModifierValue&&> modifier_callback, NodeTools::key_map_t&& key_map) const; template<typename... Args> - NodeTools::node_callback_t expect_modifier_value_and_key_map_and_default(NodeTools::callback_t<ModifierValue&&> modifier_callback, - NodeTools::key_value_callback_t default_callback, NodeTools::key_map_t&& key_map, Args... args) const { + NodeTools::node_callback_t expect_modifier_value_and_key_map_and_default(NodeTools::callback_t<ModifierValue&&> modifier_callback, NodeTools::key_value_callback_t default_callback, NodeTools::key_map_t&& key_map, Args... args) const { NodeTools::add_key_map_entries(key_map, args...); return expect_modifier_value_and_key_map_and_default(modifier_callback, default_callback, std::move(key_map)); } |