52 if (player_data !=
nullptr) {
55 player_data =
nullptr;
69 fc_snprintf(buf,
sizeof(buf),
"player%d.%s%d", plrno, aitstr,
94 fc_snprintf(buf,
sizeof(buf),
"player%d.%s%d", plrno, aitstr,
122 struct ai_plr *orig_data =
124 struct ai_plr *created_data =
133 if (close_original) {
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.
void dai_data_init(struct ai_type *ait, struct player *pplayer)
Initialize ai data structure.
void dai_data_phase_finished(struct ai_type *ait, struct player *pplayer)
Clean up ai data after phase finished.
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.
void dai_data_close(struct ai_type *ait, struct player *pplayer)
Deinitialize ai data structure.
void dai_player_alloc(struct ai_type *ait, struct player *pplayer)
Initialize player for use with default AI.
void dai_player_copy(struct ai_type *ait, struct player *original, struct player *created)
Copy default ai data from player to player.
void dai_player_save_relations(struct ai_type *ait, const char *aitstr, struct player *pplayer, struct player *other, struct section_file *file, int plrno)
Store player specific data to savegame.
void dai_player_free(struct ai_type *ait, struct player *pplayer)
Free player from use with default AI.
void dai_gained_control(struct ai_type *ait, struct player *pplayer)
Ai got control of the player.
void dai_player_load_relations(struct ai_type *ait, const char *aitstr, struct player *pplayer, struct player *other, const struct section_file *file, int plrno)
Load player vs player specific data from savegame.
static struct ai_plr * def_ai_player_data(const struct player *pplayer, struct ai_type *deftype)
#define city_list_iterate(citylist, pcity)
#define city_list_iterate_end
void dai_assess_danger_player(struct ai_type *ait, struct player *pplayer, const struct civ_map *dmap)
Call assess_danger() for all cities owned by pplayer.
Multiplier_type_id multiplier_index(const struct multiplier *pmul)
Returns multiplier index.
#define multipliers_iterate(_mul_)
#define multipliers_iterate_end
void player_set_ai_data(struct player *pplayer, const struct ai_type *ai, void *data)
Attach ai data to player.
int player_index(const struct player *pplayer)
Return the player index.
int secfile_lookup_int_default(const struct section_file *secfile, int def, const char *path,...)
Lookup a integer value in the secfile.
#define secfile_insert_int(secfile, value, path,...)
signed char asked_about_alliance
enum war_reason war_reason
signed char asked_about_peace
signed char warned_about_space
signed char ally_patience
signed char asked_about_ceasefire
adv_want tech_want[A_LAST+1]
enum ai_level skill_level
struct city_list * cities
struct player_ai ai_common
int multipliers_target[MAX_NUM_MULTIPLIERS]
int fc_snprintf(char *str, size_t n, const char *format,...)
See also fc_utf8_snprintf_trunc(), fc_utf8_snprintf_rep().
#define advance_index_iterate_end
#define advance_index_iterate(_start, _index)