diff options
Diffstat (limited to 'src/openvic-simulation/modifier')
5 files changed, 18 insertions, 6 deletions
diff --git a/src/openvic-simulation/modifier/ModifierEffectCache.cpp b/src/openvic-simulation/modifier/ModifierEffectCache.cpp index afb733a..a02dcb6 100644 --- a/src/openvic-simulation/modifier/ModifierEffectCache.cpp +++ b/src/openvic-simulation/modifier/ModifierEffectCache.cpp @@ -181,6 +181,7 @@ ModifierEffectCache::ModifierEffectCache() farm_rgo_throughput_global { nullptr }, farm_rgo_output_global { nullptr }, farm_rgo_output_local { nullptr }, + farm_rgo_size_fake { nullptr }, farm_rgo_size_global { nullptr }, farm_rgo_size_local { nullptr }, immigrant_attract { nullptr }, @@ -202,6 +203,7 @@ ModifierEffectCache::ModifierEffectCache() mine_rgo_throughput_global { nullptr }, mine_rgo_output_global { nullptr }, mine_rgo_output_local { nullptr }, + mine_rgo_size_fake { nullptr }, mine_rgo_size_global { nullptr }, mine_rgo_size_local { nullptr }, movement_cost_base { nullptr }, diff --git a/src/openvic-simulation/modifier/ModifierEffectCache.hpp b/src/openvic-simulation/modifier/ModifierEffectCache.hpp index 757eca0..7d08d29 100644 --- a/src/openvic-simulation/modifier/ModifierEffectCache.hpp +++ b/src/openvic-simulation/modifier/ModifierEffectCache.hpp @@ -151,6 +151,7 @@ namespace OpenVic { ModifierEffect const* PROPERTY(farm_rgo_throughput_global); ModifierEffect const* PROPERTY(farm_rgo_output_global); ModifierEffect const* PROPERTY(farm_rgo_output_local); + ModifierEffect const* PROPERTY(farm_rgo_size_fake); ModifierEffect const* PROPERTY(farm_rgo_size_global); ModifierEffect const* PROPERTY(farm_rgo_size_local); ModifierEffect const* PROPERTY(immigrant_attract); @@ -172,6 +173,7 @@ namespace OpenVic { ModifierEffect const* PROPERTY(mine_rgo_throughput_global); ModifierEffect const* PROPERTY(mine_rgo_output_global); ModifierEffect const* PROPERTY(mine_rgo_output_local); + ModifierEffect const* PROPERTY(mine_rgo_size_fake); ModifierEffect const* PROPERTY(mine_rgo_size_global); ModifierEffect const* PROPERTY(mine_rgo_size_local); ModifierEffect const* PROPERTY(movement_cost_base); diff --git a/src/openvic-simulation/modifier/ModifierManager.cpp b/src/openvic-simulation/modifier/ModifierManager.cpp index 9d6d3f8..3bc0c97 100644 --- a/src/openvic-simulation/modifier/ModifierManager.cpp +++ b/src/openvic-simulation/modifier/ModifierManager.cpp @@ -428,7 +428,11 @@ bool ModifierManager::setup_modifier_effects() { ret &= register_base_province_modifier_effect( modifier_effect_cache.farm_rgo_output_local, "farm_rgo_eff", true, PROPORTION_DECIMAL, "TECH_FARM_OUTPUT" ); - ret &= register_shared_tech_country_modifier_effect( + ret &= register_base_country_modifier_effect( + modifier_effect_cache.farm_rgo_size_fake, "farm_rgo_size", true, PROPORTION_DECIMAL, + ModifierEffect::make_default_modifier_effect_localisation_key("farm_size"), has_no_effect + ); + ret &= register_technology_modifier_effect( modifier_effect_cache.farm_rgo_size_global, "farm_rgo_size", true, PROPORTION_DECIMAL, ModifierEffect::make_default_modifier_effect_localisation_key("farm_size") ); @@ -499,7 +503,11 @@ bool ModifierManager::setup_modifier_effects() { ret &= register_base_province_modifier_effect( modifier_effect_cache.mine_rgo_output_local, "mine_rgo_eff", true, PROPORTION_DECIMAL, "TECH_MINE_OUTPUT" ); - ret &= register_shared_tech_country_modifier_effect( + ret &= register_base_country_modifier_effect( + modifier_effect_cache.mine_rgo_size_fake, "mine_rgo_size", true, PROPORTION_DECIMAL, + ModifierEffect::make_default_modifier_effect_localisation_key("mine_size"), has_no_effect + ); + ret &= register_technology_modifier_effect( modifier_effect_cache.mine_rgo_size_global, "mine_rgo_size", true, PROPORTION_DECIMAL, ModifierEffect::make_default_modifier_effect_localisation_key("mine_size") ); diff --git a/src/openvic-simulation/modifier/ModifierValue.cpp b/src/openvic-simulation/modifier/ModifierValue.cpp index e3e7b0b..4461048 100644 --- a/src/openvic-simulation/modifier/ModifierValue.cpp +++ b/src/openvic-simulation/modifier/ModifierValue.cpp @@ -96,14 +96,14 @@ ModifierValue ModifierValue::operator-(ModifierValue const& right) const { return copy -= right; } -ModifierValue& ModifierValue::operator*=(fixed_point_t const& right) { +ModifierValue& ModifierValue::operator*=(const fixed_point_t right) { for (auto value : mutable_iterator(values)) { value.second *= right; } return *this; } -ModifierValue ModifierValue::operator*(fixed_point_t const& right) const { +ModifierValue ModifierValue::operator*(const fixed_point_t right) const { ModifierValue copy = *this; return copy *= right; } diff --git a/src/openvic-simulation/modifier/ModifierValue.hpp b/src/openvic-simulation/modifier/ModifierValue.hpp index 6e6a29b..f693b7a 100644 --- a/src/openvic-simulation/modifier/ModifierValue.hpp +++ b/src/openvic-simulation/modifier/ModifierValue.hpp @@ -37,8 +37,8 @@ namespace OpenVic { ModifierValue operator-() const; ModifierValue& operator-=(ModifierValue const& right); ModifierValue operator-(ModifierValue const& right) const; - ModifierValue& operator*=(fixed_point_t const& right); - ModifierValue operator*(fixed_point_t const& right) const; + ModifierValue& operator*=(const fixed_point_t right); + ModifierValue operator*(const fixed_point_t right) const; void apply_exclude_targets(ModifierEffect::target_t excluded_targets); void multiply_add_exclude_targets( |