aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/economy/Good.cpp
diff options
context:
space:
mode:
author zaaarf <zaaarf@proton.me>2023-11-30 21:20:37 +0100
committer zaaarf <zaaarf@proton.me>2023-12-02 01:12:12 +0100
commitc935e471782764dcc10a3175741a02ab3ffffa8e (patch)
tree49016457c09ef3583b200a8bd016dc702b6e298e /src/openvic-simulation/economy/Good.cpp
parent51583b66feb1d13b285bb2e9c05364659c854130 (diff)
feat: implemented modifier identifier flattening, added/fixed remaining tech modifiers effects
Diffstat (limited to 'src/openvic-simulation/economy/Good.cpp')
-rw-r--r--src/openvic-simulation/economy/Good.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/openvic-simulation/economy/Good.cpp b/src/openvic-simulation/economy/Good.cpp
index b068644..739374b 100644
--- a/src/openvic-simulation/economy/Good.cpp
+++ b/src/openvic-simulation/economy/Good.cpp
@@ -95,3 +95,21 @@ bool GoodManager::load_goods_file(ast::NodeCPtr root) {
lock_goods();
return ret;
}
+
+#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); \
+ }
+
+
+bool GoodManager::generate_modifiers(ModifierManager& modifier_manager) {
+ bool ret = true;
+ GOOD_MODIFIER("factory_goods_output");
+ GOOD_MODIFIER("rgo_goods_output");
+ GOOD_MODIFIER("rgo_size");
+ return ret;
+} \ No newline at end of file