aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/Modifier.hpp
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-09-26 16:19:27 +0200
committer Hop311 <hop3114@gmail.com>2023-09-26 16:19:27 +0200
commitf19c9fbbb8983371ebf79affadfcc45c44a28a43 (patch)
treef7bde3ca629159758054867bae750e02ce0612a3 /src/openvic-simulation/Modifier.hpp
parent63e462fceff981f79bcbae53e8d90fc59733e8c2 (diff)
Expect modifier value + keys function
Diffstat (limited to 'src/openvic-simulation/Modifier.hpp')
-rw-r--r--src/openvic-simulation/Modifier.hpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/openvic-simulation/Modifier.hpp b/src/openvic-simulation/Modifier.hpp
index ea302b2..bfd9ca7 100644
--- a/src/openvic-simulation/Modifier.hpp
+++ b/src/openvic-simulation/Modifier.hpp
@@ -92,6 +92,17 @@ namespace OpenVic {
IdentifierRegistry<ModifierEffect> modifier_effects;
IdentifierRegistry<Modifier> modifiers;
+ NodeTools::node_callback_t _expect_modifier_value_and_keys(NodeTools::callback_t<ModifierValue&&> modifier_callback, NodeTools::key_map_t&& key_map) const;
+
+ template<typename... Args>
+ NodeTools::node_callback_t _expect_modifier_value_and_keys(
+ NodeTools::callback_t<ModifierValue&&> modifier_callback, NodeTools::key_map_t&& key_map,
+ const std::string_view key, NodeTools::dictionary_entry_t::expected_count_t expected_count, NodeTools::node_callback_t callback,
+ Args... args) const {
+ NodeTools::add_key_map_entry(key_map, key, expected_count, callback);
+ return _expect_modifier_value_and_keys(modifier_callback, std::move(key_map), args...);
+ }
+
public:
ModifierManager();
@@ -103,6 +114,11 @@ namespace OpenVic {
bool setup_modifier_effects();
- NodeTools::node_callback_t expect_modifier_value(NodeTools::callback_t<ModifierValue&&> callback, NodeTools::key_value_callback_t default_callback) const;
+ NodeTools::node_callback_t expect_modifier_value(NodeTools::callback_t<ModifierValue&&> modifier_callback, NodeTools::key_value_callback_t default_callback) const;
+
+ template<typename... Args>
+ NodeTools::node_callback_t expect_modifier_value_and_keys(NodeTools::callback_t<ModifierValue&&> modifier_callback, Args... args) const {
+ return _expect_modifier_value_and_keys(modifier_callback, {}, args...);
+ }
};
}