aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/defines/AIDefines.cpp
blob: 1229daa900f7e1e73090e4f98140e282684684c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#include "AIDefines.hpp"

using namespace OpenVic;
using namespace OpenVic::NodeTools;

AIDefines::AIDefines()
  : colony_weight {},
   administrator_weight {},
   industryworker_weight {},
   educator_weight {},
   soldier_weight {},
   soldier_fraction {},
   capitalist_fraction {},
   production_weight {},
   spam_penalty {},
   one_side_max_warscore {},
   pop_project_investment_max_budget_factor {},
   relation_limit_no_alliance_offer {},
   naval_supply_penalty_limit {},
   chance_build_railroad {},
   chance_build_naval_base {},
   chance_build_fort {},
   chance_invest_pop_proj {},
   chance_foreign_invest {},
   tws_awareness_score_low_cap {},
   tws_awareness_score_aspect {},
   peace_base_reluctance {},
   peace_time_duration {},
   peace_time_factor {},
   peace_time_factor_no_goals {},
   peace_war_exhaustion_factor {},
   peace_war_direction_factor {},
   peace_war_direction_winning_mult {},
   peace_force_balance_factor {},
   peace_ally_base_reluctance_mult {},
   peace_ally_time_mult {},
   peace_ally_war_exhaustion_mult {},
   peace_ally_war_direction_mult {},
   peace_ally_force_balance_mult {},
   aggression_base {},
   aggression_unciv_bonus {},
   fleet_size {},
   min_fleets {},
   max_fleets {},
   time_before_disband {} {}

std::string_view AIDefines::get_name() const {
   return "ai";
}

node_callback_t AIDefines::expect_defines() {
   return expect_dictionary_keys(
      "COLONY_WEIGHT", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(colony_weight)),
      "ADMINISTRATOR_WEIGHT", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(administrator_weight)),
      "INDUSTRYWORKER_WEIGHT", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(industryworker_weight)),
      "EDUCATOR_WEIGHT", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(educator_weight)),
      "SOLDIER_WEIGHT", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(soldier_weight)),
      "SOLDIER_FRACTION", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(soldier_fraction)),
      "CAPITALIST_FRACTION", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(capitalist_fraction)),
      "PRODUCTION_WEIGHT", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(production_weight)),
      "SPAM_PENALTY", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(spam_penalty)),
      "ONE_SIDE_MAX_WARSCORE", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(one_side_max_warscore)),
      "POP_PROJECT_INVESTMENT_MAX_BUDGET_FACTOR", ONE_EXACTLY,
         expect_fixed_point(assign_variable_callback(pop_project_investment_max_budget_factor)),
      "RELATION_LIMIT_NO_ALLIANCE_OFFER", ONE_EXACTLY,
         expect_fixed_point(assign_variable_callback(relation_limit_no_alliance_offer)),
      "NAVAL_SUPPLY_PENALTY_LIMIT", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(naval_supply_penalty_limit)),
      "CHANCE_BUILD_RAILROAD", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(chance_build_railroad)),
      "CHANCE_BUILD_NAVAL_BASE", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(chance_build_naval_base)),
      "CHANCE_BUILD_FORT", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(chance_build_fort)),
      "CHANCE_INVEST_POP_PROJ", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(chance_invest_pop_proj)),
      "CHANCE_FOREIGN_INVEST", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(chance_foreign_invest)),
      "TWS_AWARENESS_SCORE_LOW_CAP", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(tws_awareness_score_low_cap)),
      "TWS_AWARENESS_SCORE_ASPECT", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(tws_awareness_score_aspect)),
      "PEACE_BASE_RELUCTANCE", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(peace_base_reluctance)),
      "PEACE_TIME_MONTHS", ONE_EXACTLY, expect_months(assign_variable_callback(peace_time_duration)),
      "PEACE_TIME_FACTOR", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(peace_time_factor)),
      "PEACE_TIME_FACTOR_NO_GOALS", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(peace_time_factor_no_goals)),
      "PEACE_WAR_EXHAUSTION_FACTOR", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(peace_war_exhaustion_factor)),
      "PEACE_WAR_DIRECTION_FACTOR", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(peace_war_direction_factor)),
      "PEACE_WAR_DIRECTION_WINNING_MULT", ONE_EXACTLY,
         expect_fixed_point(assign_variable_callback(peace_war_direction_winning_mult)),
      "PEACE_FORCE_BALANCE_FACTOR", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(peace_force_balance_factor)),
      "PEACE_ALLY_BASE_RELUCTANCE_MULT", ONE_EXACTLY,
         expect_fixed_point(assign_variable_callback(peace_ally_base_reluctance_mult)),
      "PEACE_ALLY_TIME_MULT", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(peace_ally_time_mult)),
      "PEACE_ALLY_WAR_EXHAUSTION_MULT", ONE_EXACTLY,
         expect_fixed_point(assign_variable_callback(peace_ally_war_exhaustion_mult)),
      "PEACE_ALLY_WAR_DIRECTION_MULT", ONE_EXACTLY,
         expect_fixed_point(assign_variable_callback(peace_ally_war_direction_mult)),
      "PEACE_ALLY_FORCE_BALANCE_MULT", ONE_EXACTLY,
         expect_fixed_point(assign_variable_callback(peace_ally_force_balance_mult)),
      "AGGRESSION_BASE", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(aggression_base)),
      "AGGRESSION_UNCIV_BONUS", ONE_EXACTLY, expect_fixed_point(assign_variable_callback(aggression_unciv_bonus)),
      "FLEET_SIZE", ONE_EXACTLY, expect_uint(assign_variable_callback(fleet_size)),
      "MIN_FLEETS", ONE_EXACTLY, expect_uint(assign_variable_callback(min_fleets)),
      "MAX_FLEETS", ONE_EXACTLY, expect_uint(assign_variable_callback(max_fleets)),
      "MONTHS_BEFORE_DISBAND", ONE_EXACTLY, expect_months(assign_variable_callback(time_before_disband))
   );
}