aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/Modifier.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-09-19 17:40:09 +0200
committer GitHub <noreply@github.com>2023-09-19 17:40:09 +0200
commit9c89100e0c8854dff3174b078d235148585a8b03 (patch)
tree77f81dfd3ec85a659741e979c148b33b22595dd0 /src/openvic-simulation/Modifier.hpp
parent64d134ad20c333afa60373526d6fab27a07c6adc (diff)
parent72add97c47f0d17fc0019bb4cfec7506740a9c7d (diff)
Merge pull request #17 from OpenVicProject/dataloading-the-third
Scaffolding for `positions.txt` + modifier loading
Diffstat (limited to 'src/openvic-simulation/Modifier.hpp')
-rw-r--r--src/openvic-simulation/Modifier.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/openvic-simulation/Modifier.hpp b/src/openvic-simulation/Modifier.hpp
index eb63788..acdadfe 100644
--- a/src/openvic-simulation/Modifier.hpp
+++ b/src/openvic-simulation/Modifier.hpp
@@ -25,6 +25,8 @@ namespace OpenVic {
};
struct ModifierValue {
+ friend struct ModifierManager;
+
using effect_map_t = std::map<ModifierEffect const*, fixed_point_t>;
private:
effect_map_t values;
@@ -57,6 +59,7 @@ namespace OpenVic {
using icon_t = uint8_t;
private:
+ /* A modifier can have no icon (zero). */
const icon_t icon;
Modifier(const std::string_view new_identifier, ModifierValue&& new_values, icon_t new_icon);
@@ -92,5 +95,7 @@ namespace OpenVic {
bool add_modifier(const std::string_view identifier, ModifierValue&& values, Modifier::icon_t icon);
IDENTIFIER_REGISTRY_ACCESSORS(Modifier, modifier)
+
+ NodeTools::node_callback_t expect_modifier_value(NodeTools::callback_t<ModifierValue&&> callback) const;
};
}