From e067471f55cd11c6cd86920f9486991d6b552726 Mon Sep 17 00:00:00 2001 From: hop311 Date: Wed, 3 Jan 2024 00:13:39 +0000 Subject: Mutually exclusive rule groups + modded building rules --- src/openvic-simulation/economy/Good.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/openvic-simulation/economy/Good.cpp') diff --git a/src/openvic-simulation/economy/Good.cpp b/src/openvic-simulation/economy/Good.cpp index 3b420f1..2170666 100644 --- a/src/openvic-simulation/economy/Good.cpp +++ b/src/openvic-simulation/economy/Good.cpp @@ -93,25 +93,24 @@ bool GoodManager::load_goods_file(ast::NodeCPtr root) { bool GoodManager::generate_modifiers(ModifierManager& modifier_manager) const { bool ret = true; - const auto good_modifier = [this, &modifier_manager, &ret](std::string_view name) -> void { + const auto good_modifier = [this, &modifier_manager, &ret](std::string_view name, bool positive_good) -> void { ret &= modifier_manager.register_complex_modifier(name); for (Good const& good : get_goods()) { ret &= modifier_manager.add_modifier_effect( - StringUtils::append_string_views(name, "_", good.get_identifier()), true + StringUtils::append_string_views(name, "_", good.get_identifier()), positive_good ); } }; - good_modifier("artisan_goods_input"); - good_modifier("artisan_goods_output"); - good_modifier("artisan_goods_throughput"); - good_modifier("factory_goods_input"); - good_modifier("factory_goods_output"); - good_modifier("factory_goods_throughput"); - good_modifier("rgo_goods_input"); - good_modifier("rgo_goods_output"); - good_modifier("rgo_goods_throughput"); - good_modifier("rgo_size"); + good_modifier("artisan_goods_input", false); + good_modifier("artisan_goods_output", true); + good_modifier("artisan_goods_throughput", true); + good_modifier("factory_goods_input", false); + good_modifier("factory_goods_output", true); + good_modifier("factory_goods_throughput", true); + good_modifier("rgo_goods_output", true); + good_modifier("rgo_goods_throughput", true); + good_modifier("rgo_size", true); return ret; } -- cgit v1.2.3-56-ga3b1