aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/Modifier.hpp
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-09-16 17:27:41 +0200
committer Hop311 <hop3114@gmail.com>2023-09-16 17:28:01 +0200
commitf95902fdd85f86c10b9c300099c67312fc81f11b (patch)
tree1655119602f39a366de8248cb4651321b6dfdda0 /src/openvic-simulation/Modifier.hpp
parent64d134ad20c333afa60373526d6fab27a07c6adc (diff)
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;
};
}