aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/defines/EconomyDefines.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-10-31 20:29:34 +0100
committer hop311 <hop3114@gmail.com>2024-10-31 20:54:50 +0100
commitdbf58b1b1d318b4a82cf22b5b8e720c753388f4b (patch)
treed6d2be10697d6fa320f7f8da14eda45111bd9399 /src/openvic-simulation/defines/EconomyDefines.cpp
parentc763a0aedd834432b54b6e49c6bc7e1936be1131 (diff)
Load defines directly into named and typed variables rather than using an IdentifierRegistrydefines-variables
Diffstat (limited to 'src/openvic-simulation/defines/EconomyDefines.cpp')
-rw-r--r--src/openvic-simulation/defines/EconomyDefines.cpp92
1 files changed, 92 insertions, 0 deletions
diff --git a/src/openvic-simulation/defines/EconomyDefines.cpp b/src/openvic-simulation/defines/EconomyDefines.cpp
new file mode 100644
index 0000000..57c0157
--- /dev/null
+++ b/src/openvic-simulation/defines/EconomyDefines.cpp
@@ -0,0 +1,92 @@
+#include "EconomyDefines.hpp"
+
+using namespace OpenVic;
+using namespace OpenVic::NodeTools;
+
+EconomyDefines::EconomyDefines()
+ : max_daily_research {},
+ loan_base_interest {},
+ bankruptcy_external_loan_duration {},
+ bankruptcy_factor {},
+ shadowy_financiers_max_loan_amount {},
+ max_loan_cap_from_banks {},
+ gunboat_low_tax_cap {},
+ gunboat_high_tax_cap {},
+ gunboat_fleet_size_factor {},
+ province_size_divider {},
+ capitalist_build_factory_state_employment_percent {},
+ goods_focus_swap_chance {},
+ num_closed_factories_per_state_lassiez_faire {},
+ min_num_factories_per_state_before_deleting_lassiez_faire {},
+ bankrupcy_duration {},
+ second_rank_base_share_factor {},
+ civ_base_share_factor {},
+ unciv_base_share_factor {},
+ factory_paychecks_leftover_factor {},
+ max_factory_money_save {},
+ small_debt_limit {},
+ factory_upgrade_employee_factor {},
+ rgo_supply_demand_factor_hire_hi {},
+ rgo_supply_demand_factor_hire_lo {},
+ rgo_supply_demand_factor_fire {},
+ employment_hire_lowest {},
+ employment_fire_lowest {},
+ trade_cap_low_limit_land {},
+ trade_cap_low_limit_naval {},
+ trade_cap_low_limit_constructions {},
+ factory_purchase_min_factor {},
+ factory_purchase_drawdown_factor {} {}
+
+std::string_view EconomyDefines::get_name() const {
+ return "economy";
+}
+
+node_callback_t EconomyDefines::expect_defines() {
+ return expect_dictionary_keys(
+ "MAX_DAILY_RESEARCH", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(max_daily_research)),
+ "LOAN_BASE_INTEREST", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(loan_base_interest)),
+ "BANKRUPTCY_EXTERNAL_LOAN_YEARS", ONE_EXACTLY,
+ expect_years(assign_variable_callback(bankruptcy_external_loan_duration)),
+ "BANKRUPTCY_FACTOR", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(bankruptcy_factor)),
+ "SHADOWY_FINANCIERS_MAX_LOAN_AMOUNT", ONE_EXACTLY,
+ expect_fixed_point(assign_variable_callback(shadowy_financiers_max_loan_amount)),
+ "MAX_LOAN_CAP_FROM_BANKS", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(max_loan_cap_from_banks)),
+ "GUNBOAT_LOW_TAX_CAP", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(gunboat_low_tax_cap)),
+ "GUNBOAT_HIGH_TAX_CAP", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(gunboat_high_tax_cap)),
+ "GUNBOAT_FLEET_SIZE_FACTOR", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(gunboat_fleet_size_factor)),
+ "PROVINCE_SIZE_DIVIDER", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(province_size_divider)),
+ "CAPITALIST_BUILD_FACTORY_STATE_EMPLOYMENT_PERCENT", ONE_EXACTLY,
+ expect_fixed_point(assign_variable_callback(capitalist_build_factory_state_employment_percent)),
+ "GOODS_FOCUS_SWAP_CHANCE", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(goods_focus_swap_chance)),
+ "NUM_CLOSED_FACTORIES_PER_STATE_LASSIEZ_FAIRE", ONE_EXACTLY,
+ expect_uint(assign_variable_callback(num_closed_factories_per_state_lassiez_faire)),
+ "MIN_NUM_FACTORIES_PER_STATE_BEFORE_DELETING_LASSIEZ_FAIRE", ONE_EXACTLY,
+ expect_uint(assign_variable_callback(min_num_factories_per_state_before_deleting_lassiez_faire)),
+ "BANKRUPCY_DURATION", ONE_EXACTLY, expect_years(assign_variable_callback(bankrupcy_duration)),
+ "SECOND_RANK_BASE_SHARE_FACTOR", ONE_EXACTLY,
+ expect_fixed_point(assign_variable_callback(second_rank_base_share_factor)),
+ "CIV_BASE_SHARE_FACTOR", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(civ_base_share_factor)),
+ "UNCIV_BASE_SHARE_FACTOR", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(unciv_base_share_factor)),
+ "FACTORY_PAYCHECKS_LEFTOVER_FACTOR", ONE_EXACTLY,
+ expect_fixed_point(assign_variable_callback(factory_paychecks_leftover_factor)),
+ "MAX_FACTORY_MONEY_SAVE", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(max_factory_money_save)),
+ "SMALL_DEBT_LIMIT", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(small_debt_limit)),
+ "FACTORY_UPGRADE_EMPLOYEE_FACTOR", ONE_EXACTLY,
+ expect_fixed_point(assign_variable_callback(factory_upgrade_employee_factor)),
+ "RGO_SUPPLY_DEMAND_FACTOR_HIRE_HI", ONE_EXACTLY,
+ expect_fixed_point(assign_variable_callback(rgo_supply_demand_factor_hire_hi)),
+ "RGO_SUPPLY_DEMAND_FACTOR_HIRE_LO", ONE_EXACTLY,
+ expect_fixed_point(assign_variable_callback(rgo_supply_demand_factor_hire_lo)),
+ "RGO_SUPPLY_DEMAND_FACTOR_FIRE", ONE_EXACTLY,
+ expect_fixed_point(assign_variable_callback(rgo_supply_demand_factor_fire)),
+ "EMPLOYMENT_HIRE_LOWEST", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(employment_hire_lowest)),
+ "EMPLOYMENT_FIRE_LOWEST", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(employment_fire_lowest)),
+ "TRADE_CAP_LOW_LIMIT_LAND", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(trade_cap_low_limit_land)),
+ "TRADE_CAP_LOW_LIMIT_NAVAL", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(trade_cap_low_limit_naval)),
+ "TRADE_CAP_LOW_LIMIT_CONSTRUCTIONS", ONE_EXACTLY,
+ expect_fixed_point(assign_variable_callback(trade_cap_low_limit_constructions)),
+ "FACTORY_PURCHASE_MIN_FACTOR", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(factory_purchase_min_factor)),
+ "FACTORY_PURCHASE_DRAWDOWN_FACTOR", ONE_EXACTLY,
+ expect_fixed_point(assign_variable_callback(factory_purchase_drawdown_factor))
+ );
+}