aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/economy/Good.cpp
diff options
context:
space:
mode:
author zaaarf <80046572+zaaarf@users.noreply.github.com>2023-12-05 22:53:07 +0100
committer GitHub <noreply@github.com>2023-12-05 22:53:07 +0100
commit48a3f1729d709847d7cad33f594c77cac414e802 (patch)
treed890ed3ca182a960a35e5d1edae16e32e7f2b836 /src/openvic-simulation/economy/Good.cpp
parentdb00dcfb8c72448fea73e752e1f5c18047738876 (diff)
parentfa2ca50905f327713207069cf9a2e66cf6c00076 (diff)
Merge pull request #83 from OpenVicProject/dataloading-inventions
Dataloading inventions
Diffstat (limited to 'src/openvic-simulation/economy/Good.cpp')
-rw-r--r--src/openvic-simulation/economy/Good.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/openvic-simulation/economy/Good.cpp b/src/openvic-simulation/economy/Good.cpp
index 2aa5d42..02c4f0b 100644
--- a/src/openvic-simulation/economy/Good.cpp
+++ b/src/openvic-simulation/economy/Good.cpp
@@ -99,16 +99,20 @@ bool GoodManager::load_goods_file(ast::NodeCPtr root) {
#define GOOD_MODIFIER(name) \
modifier_manager.register_complex_modifier(name); \
for (Good const& good : this->get_goods()) { \
- std::string modifier_name = name; \
- modifier_name += "_"; \
- modifier_name += good.get_identifier(); \
- ret &= modifier_manager.add_modifier_effect(modifier_name, true, ModifierEffect::format_t::PROPORTION_DECIMAL); \
+ ret &= modifier_manager.add_modifier_effect( \
+ StringUtils::append_string_views(name, "_", good.get_identifier()), \
+ true, \
+ ModifierEffect::format_t::PROPORTION_DECIMAL \
+ ); \
}
bool GoodManager::generate_modifiers(ModifierManager& modifier_manager) {
bool ret = true;
GOOD_MODIFIER("factory_goods_output");
+ GOOD_MODIFIER("factory_goods_throughput");
GOOD_MODIFIER("rgo_goods_output");
GOOD_MODIFIER("rgo_size");
return ret;
-} \ No newline at end of file
+}
+
+#undef GOOD_MODIFIER \ No newline at end of file