diff options
author | hop311 <hop3114@gmail.com> | 2024-10-19 12:43:15 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-10-19 12:44:53 +0200 |
commit | 5194a3d043db66b81470111a94f3b1cdf8d42176 (patch) | |
tree | aca829171be7b1144cb3ca29510593fa8a84af24 /src/openvic-simulation/modifier/ModifierManager.hpp | |
parent | 572ac597d8b43c4c97be4b68aa40de0e7ae6bfe0 (diff) |
Add modifier effect variants based on the type of modifier being parsedresultant-modifier
Diffstat (limited to 'src/openvic-simulation/modifier/ModifierManager.hpp')
-rw-r--r-- | src/openvic-simulation/modifier/ModifierManager.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/openvic-simulation/modifier/ModifierManager.hpp b/src/openvic-simulation/modifier/ModifierManager.hpp index f3673b0..51f89ae 100644 --- a/src/openvic-simulation/modifier/ModifierManager.hpp +++ b/src/openvic-simulation/modifier/ModifierManager.hpp @@ -19,6 +19,8 @@ namespace OpenVic { friend struct PopManager; friend struct TechnologyManager; + using effect_variant_map_t = ordered_map<Modifier::modifier_type_t, ModifierEffect const*>; + /* Some ModifierEffects are generated mid-load, such as max/min count modifiers for each building, so * we can't lock it until loading is over. This means we can't rely on locking for pointer stability, * so instead we store the effects in a deque which doesn't invalidate pointers on insert. @@ -26,6 +28,7 @@ namespace OpenVic { private: CaseInsensitiveIdentifierRegistry<ModifierEffect, RegistryStorageInfoDeque> IDENTIFIER_REGISTRY(modifier_effect); case_insensitive_string_set_t complex_modifiers; + string_map_t<effect_variant_map_t> modifier_effect_variants; IdentifierRegistry<IconModifier> IDENTIFIER_REGISTRY(event_modifier); IdentifierRegistry<Modifier> IDENTIFIER_REGISTRY(static_modifier); @@ -55,6 +58,10 @@ namespace OpenVic { std::string_view complex_modifier_identifier, std::string_view variant_identifier ); + bool register_modifier_effect_variants( + std::string const& identifier, ModifierEffect const* effect, std::vector<Modifier::modifier_type_t> const& types + ); + bool setup_modifier_effects(); bool add_event_modifier(std::string_view identifier, ModifierValue&& values, IconModifier::icon_t icon); |