diff options
author | hop311 <hop3114@gmail.com> | 2024-09-11 23:07:12 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-09-12 23:08:42 +0200 |
commit | a424969548083a977480a6be0f078760a5789bbf (patch) | |
tree | 7754de92a23f21e0546dcd09439bf0d3962b096f /src/openvic-simulation/misc | |
parent | 237e42fd1cdff02862c6a2279c7cad9786ab0e65 (diff) |
Country reforms and rulescountry-unlock
Diffstat (limited to 'src/openvic-simulation/misc')
-rw-r--r-- | src/openvic-simulation/misc/Modifier.cpp | 9 | ||||
-rw-r--r-- | src/openvic-simulation/misc/Modifier.hpp | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/openvic-simulation/misc/Modifier.cpp b/src/openvic-simulation/misc/Modifier.cpp index 4d6abb7..9163af5 100644 --- a/src/openvic-simulation/misc/Modifier.cpp +++ b/src/openvic-simulation/misc/Modifier.cpp @@ -33,6 +33,14 @@ size_t ModifierValue::get_effect_count() const { return values.size(); } +void ModifierValue::clear() { + values.clear(); +} + +bool ModifierValue::empty() const { + return values.empty(); +} + fixed_point_t ModifierValue::get_effect(ModifierEffect const* effect, bool* successful) { const effect_map_t::const_iterator it = values.find(effect); if (it != values.end()) { @@ -123,7 +131,6 @@ bool ModifierManager::setup_modifier_effects() { /* Country Modifier Effects */ ret &= add_modifier_effect("administrative_efficiency", true); ret &= add_modifier_effect("administrative_efficiency_modifier", true); - ret &= add_modifier_effect("administrative_multiplier", true); ret &= add_modifier_effect("artisan_input", false); ret &= add_modifier_effect("artisan_output", true); ret &= add_modifier_effect("artisan_throughput", true); diff --git a/src/openvic-simulation/misc/Modifier.hpp b/src/openvic-simulation/misc/Modifier.hpp index 58b335d..bd72a1e 100644 --- a/src/openvic-simulation/misc/Modifier.hpp +++ b/src/openvic-simulation/misc/Modifier.hpp @@ -37,7 +37,7 @@ namespace OpenVic { using effect_map_t = fixed_point_map_t<ModifierEffect const*>; private: - effect_map_t values; + effect_map_t PROPERTY(values); public: ModifierValue(); @@ -51,6 +51,8 @@ namespace OpenVic { /* Removes effect entries with a value of zero. */ void trim(); size_t get_effect_count() const; + void clear(); + bool empty() const; fixed_point_t get_effect(ModifierEffect const* effect, bool* successful = nullptr); bool has_effect(ModifierEffect const* effect) const; |