![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include "game.h"#include "government.h"#include "multipliers.h"#include "research.h"#include "aiactions.h"#include "cityturn.h"#include "plrhand.h"#include "advdata.h"#include "aiferry.h"#include "aiplayer.h"#include "aisettler.h"#include "aiunit.h"#include "daicity.h"#include "daidiplomacy.h"#include "daieffects.h"#include "aidata.h"
Include dependency graph for aidata.cpp:Go to the source code of this file.
Functions | |
| static void | dai_diplomacy_new (struct ai_type *ait, const struct player *plr1, const struct player *plr2) |
| Allocate new ai diplomacy slot. More... | |
| static void | dai_diplomacy_defaults (struct ai_type *ait, const struct player *plr1, const struct player *plr2) |
| Set diplomacy data between two players to its default values. More... | |
| static void | dai_diplomacy_destroy (struct ai_type *ait, const struct player *plr1, const struct player *plr2) |
| Free resources allocated for diplomacy information between two players. More... | |
| void | dai_data_init (struct ai_type *ait, struct player *pplayer) |
| Initialize ai data structure. More... | |
| void | dai_data_close (struct ai_type *ait, struct player *pplayer) |
| Deinitialize ai data structure. More... | |
| bool | is_ai_data_phase_open (struct ai_type *ait, struct player *pplayer) |
| Return whether data phase is currently open. More... | |
| void | dai_data_phase_begin (struct ai_type *ait, struct player *pplayer, bool is_new_phase) |
| Make and cache lots of calculations needed for other functions. More... | |
| void | dai_data_phase_finished (struct ai_type *ait, struct player *pplayer) |
| Clean up ai data after phase finished. More... | |
| struct ai_plr * | dai_plr_data_get (struct ai_type *ait, struct player *pplayer, bool *caller_closes) |
| Get current default ai data related to player. More... | |
| struct ai_dip_intel * | dai_diplomacy_get (struct ai_type *ait, const struct player *plr1, const struct player *plr2) |
| Returns diplomatic state type between two players. More... | |
| void | dai_adjust_policies (struct ai_type *ait, struct player *pplayer) |
| Adjust multiplier values. More... | |
| void | dai_gov_value (struct ai_type *ait, struct player *pplayer, struct government *gov, adv_want *val, bool *override) |
| Set value of the government. More... | |
Adjust multiplier values.
Definition at line 437 of file aidata.cpp.
Referenced by dai_do_last_activities().
Deinitialize ai data structure.
Definition at line 98 of file aidata.cpp.
Referenced by dai_player_free(), tai_player_free(), and texai_player_free().
Initialize ai data structure.
Definition at line 50 of file aidata.cpp.
Referenced by dai_player_alloc(), tai_player_alloc(), and texai_player_alloc().
Make and cache lots of calculations needed for other functions.
Definition at line 138 of file aidata.cpp.
Referenced by cai_data_phase_begin(), dai_plr_data_get(), texwai_phase_begin(), and twai_phase_begin().
Clean up ai data after phase finished.
Definition at line 281 of file aidata.cpp.
Referenced by cai_data_phase_finished(), dai_auto_settler_reset(), dai_data_close(), dai_goldequiv_clause(), dai_player_copy(), dai_plr_data_get(), dai_treaty_accepted(), texwai_phase_finished(), and twai_phase_finished().
|
static |
Set diplomacy data between two players to its default values.
Definition at line 374 of file aidata.cpp.
Referenced by dai_data_init().
|
static |
Free resources allocated for diplomacy information between two players.
Definition at line 416 of file aidata.cpp.
Referenced by dai_data_close().
| struct ai_dip_intel* dai_diplomacy_get | ( | struct ai_type * | ait, |
| const struct player * | plr1, | ||
| const struct player * | plr2 | ||
| ) |
Returns diplomatic state type between two players.
Definition at line 397 of file aidata.cpp.
Referenced by dai_consider_plr_dangerous(), dai_data_phase_begin(), dai_diplomacy_actions(), dai_diplomacy_begin_new_phase(), dai_diplomacy_defaults(), dai_diplomacy_destroy(), dai_go_to_war(), dai_goldequiv_clause(), dai_on_war_footing(), dai_player_load_relations(), dai_player_save_relations(), dai_players_can_agree_on_ceasefire(), dai_treaty_accepted(), dai_treaty_react(), dai_war_desire(), diplo_log_prefix(), and war_countdown().
|
static |
Allocate new ai diplomacy slot.
Definition at line 353 of file aidata.cpp.
Referenced by dai_data_init().
| void dai_gov_value | ( | struct ai_type * | ait, |
| struct player * | pplayer, | ||
| struct government * | gov, | ||
| adv_want * | val, | ||
| bool * | override | ||
| ) |
Set value of the government.
Definition at line 533 of file aidata.cpp.
Referenced by cai_gov_value(), texwai_gov_value(), and twai_gov_value().
| struct ai_plr* dai_plr_data_get | ( | struct ai_type * | ait, |
| struct player * | pplayer, | ||
| bool * | caller_closes | ||
| ) |
Get current default ai data related to player.
If close is set, data phase will be opened even if it's currently closed, and the boolean will be set accordingly to tell caller that phase needs closing.
Definition at line 304 of file aidata.cpp.
Referenced by cityresult_fill(), contemplate_terrain_improvements(), dai_auto_settler_reset(), dai_diplomacy_actions(), dai_diplomacy_begin_new_phase(), dai_goldequiv_clause(), dai_player_copy(), dai_treaty_accepted(), dai_war_desire(), domestic_advisor_choose_build(), kill_something_with(), tdc_plr_get(), tdc_plr_set(), and texai_city_worker_wants().
Return whether data phase is currently open.
Data phase is open between dai_data_phase_begin() and dai_data_phase_finished() calls.
Definition at line 128 of file aidata.cpp.