aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/misc/Modifier.hpp
diff options
context:
space:
mode:
author zaaarf <zaaarf@proton.me>2023-11-30 21:20:37 +0100
committer zaaarf <zaaarf@proton.me>2023-12-02 01:12:12 +0100
commitc935e471782764dcc10a3175741a02ab3ffffa8e (patch)
tree49016457c09ef3583b200a8bd016dc702b6e298e /src/openvic-simulation/misc/Modifier.hpp
parent51583b66feb1d13b285bb2e9c05364659c854130 (diff)
feat: implemented modifier identifier flattening, added/fixed remaining tech modifiers effects
Diffstat (limited to 'src/openvic-simulation/misc/Modifier.hpp')
-rw-r--r--src/openvic-simulation/misc/Modifier.hpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/openvic-simulation/misc/Modifier.hpp b/src/openvic-simulation/misc/Modifier.hpp
index 74f0336..9f14f41 100644
--- a/src/openvic-simulation/misc/Modifier.hpp
+++ b/src/openvic-simulation/misc/Modifier.hpp
@@ -1,6 +1,7 @@
#pragma once
#include "openvic-simulation/types/IdentifierRegistry.hpp"
+#include <unordered_set>
namespace OpenVic {
struct ModifierManager;
@@ -10,7 +11,7 @@ namespace OpenVic {
PROPORTION_DECIMAL, /* An unscaled fraction/ratio, with 1 being "full"/"whole" */
PERCENTAGE_DECIMAL, /* A fraction/ratio scaled so that 100 is "full"/"whole" */
RAW_DECIMAL, /* A continuous quantity, e.g. attack strength */
- INT /* A discrete quantity, e.g. building count limit */
+ INT /* A discrete quantity, e.g. building count limit */
};
friend std::unique_ptr<ModifierEffect> std::make_unique<ModifierEffect>(std::string_view&&, bool&&, format_t&&);
@@ -99,6 +100,7 @@ namespace OpenVic {
private:
IdentifierInstanceRegistry<ModifierEffect> modifier_effects;
IdentifierRegistry<Modifier> event_modifiers;
+ string_set_t complex_modifiers;
/* effect_validator takes in ModifierEffect const& */
NodeTools::key_value_callback_t _modifier_effect_callback(
@@ -110,13 +112,14 @@ namespace OpenVic {
ModifierManager();
bool add_modifier_effect(
- std::string_view identifier, bool province_good,
+ std::string_view identifier, bool positive_good,
ModifierEffect::format_t format = ModifierEffect::format_t::PROPORTION_DECIMAL
);
IDENTIFIER_REGISTRY_ACCESSORS(modifier_effect)
bool add_event_modifier(std::string_view identifier, ModifierValue&& values, Modifier::icon_t icon);
IDENTIFIER_REGISTRY_ACCESSORS(event_modifier)
+ void register_complex_modifier(std::string_view identifier);
bool setup_modifier_effects();