Freeciv-3.1
|
Go to the source code of this file.
Data Structures | |
struct | ai_invasion |
struct | ai_city |
Macros | |
#define | BUILDING_WAIT_MINIMUM (1) |
Functions | |
void | dai_manage_cities (struct ai_type *ait, struct player *pplayer) |
void | dai_city_alloc (struct ai_type *ait, struct city *pcity) |
void | dai_city_free (struct ai_type *ait, struct city *pcity) |
void | dai_city_save (struct ai_type *ait, const char *aitstr, struct section_file *file, const struct city *pcity, const char *citystr) |
void | dai_city_load (struct ai_type *ait, const char *aitstr, const struct section_file *file, struct city *pcity, const char *citystr) |
void | want_techs_for_improvement_effect (struct ai_type *ait, struct player *pplayer, const struct city *pcity, const struct impr_type *pimprove, struct tech_vector *needed_techs, adv_want building_want) |
void | dont_want_tech_obsoleting_impr (struct ai_type *ait, struct player *pplayer, const struct city *pcity, const struct impr_type *pimprove, adv_want building_want) |
void | dai_build_adv_init (struct ai_type *ait, struct player *pplayer) |
void | dai_build_adv_adjust (struct ai_type *ait, struct player *pplayer, struct city *wonder_city) |
void | dai_consider_wonder_city (struct ai_type *ait, struct city *pcity, bool *result) |
bool | dai_can_city_build_improvement_later (const struct city *pcity, const struct impr_type *pimprove) |
bool | dai_can_player_build_improvement_later (const struct player *p, const struct impr_type *pimprove) |
Impr_type_id | dai_find_source_building (struct city *pcity, enum effect_type effect_type, const struct unit_type *utype) |
adv_want | dai_city_want (struct player *pplayer, struct city *acity, struct adv_data *adv, struct impr_type *pimprove) |
void dai_build_adv_adjust | ( | struct ai_type * | ait, |
struct player * | pplayer, | ||
struct city * | wonder_city | ||
) |
Calculate how much an AI player should want to build particular improvements, because of the effects of those improvements, and increase the want for technologies that will enable buildings with desirable effects.
Definition at line 1937 of file daicity.c.
Referenced by cai_build_adv_adjust(), texwai_build_adv_adjust(), and twai_build_adv_adjust().
Initialize building advisor. Calculates data of all players, not only of those controlled by current ai type.
Definition at line 1921 of file daicity.c.
Referenced by cai_build_adv_init(), texwai_build_adv_init(), and twai_build_adv_init().
bool dai_can_city_build_improvement_later | ( | const struct city * | pcity, |
const struct impr_type * | pimprove | ||
) |
Whether AI expects to be ever able to build given building in the city
Definition at line 2085 of file daicity.c.
Referenced by should_force_recalc().
bool dai_can_player_build_improvement_later | ( | const struct player * | p, |
const struct impr_type * | pimprove | ||
) |
Whether AI expects to be ever able to build given building
Definition at line 2116 of file daicity.c.
Referenced by dai_can_city_build_improvement_later().
Initialize city for use with default AI.
Definition at line 1113 of file daicity.c.
Referenced by cai_city_alloc(), and twai_city_alloc().
Free city from use with default AI.
Definition at line 1126 of file daicity.c.
Referenced by cai_city_free(), and twai_city_free().
void dai_city_load | ( | struct ai_type * | ait, |
const char * | aitstr, | ||
const struct section_file * | file, | ||
struct city * | pcity, | ||
const char * | citystr | ||
) |
Load ai city segment from savefile
Definition at line 1167 of file daicity.c.
Referenced by cai_city_load(), texwai_city_load(), and twai_city_load().
void dai_city_save | ( | struct ai_type * | ait, |
const char * | aitstr, | ||
struct section_file * | file, | ||
const struct city * | pcity, | ||
const char * | citystr | ||
) |
Write ai city segments to savefile
Definition at line 1140 of file daicity.c.
Referenced by cai_city_save(), texwai_city_save(), and twai_city_save().
adv_want dai_city_want | ( | struct player * | pplayer, |
struct city * | acity, | ||
struct adv_data * | adv, | ||
struct impr_type * | pimprove | ||
) |
Calculates city want from some input values. Set pimprove to NULL when nothing in the city has changed, and you just want to know the base want of a city.
Definition at line 1419 of file daicity.c.
Referenced by base_want(), dai_adjust_policies(), dai_build_adv_init(), dai_gov_value(), and dai_tech_base_want().
Is it ok for advisor code to consider given city as wonder city?
Definition at line 2052 of file daicity.c.
Referenced by cai_consider_wonder_city(), texwai_consider_wonder_city(), and twai_consider_wonder_city().
Impr_type_id dai_find_source_building | ( | struct city * | pcity, |
enum effect_type | effect_type, | ||
const struct unit_type * | utype | ||
) |
Returns a buildable, non-obsolete building that can provide the effect.
Note: this function is an inefficient hack to be used by the old AI. It will never find wonders, since that's not what the AI wants.
Definition at line 2152 of file daicity.c.
Referenced by adjust_ai_unit_choice(), assess_danger(), and military_advisor_choose_build().
One of the top level AI functions. It does (by calling other functions): worker allocations, build choices, extra gold spending.
Definition at line 853 of file daicity.c.
Referenced by dai_do_last_activities().
void dont_want_tech_obsoleting_impr | ( | struct ai_type * | ait, |
struct player * | pplayer, | ||
const struct city * | pcity, | ||
const struct impr_type * | pimprove, | ||
adv_want | building_want | ||
) |
Decrease want for a technology because of the value of that technology in obsoleting an improvement effect.
Definition at line 179 of file daicity.c.
Referenced by adjust_improvement_wants_by_effects().
void want_techs_for_improvement_effect | ( | struct ai_type * | ait, |
struct player * | pplayer, | ||
const struct city * | pcity, | ||
const struct impr_type * | pimprove, | ||
struct tech_vector * | needed_techs, | ||
adv_want | building_want | ||
) |
Increase want for a technologies because of the value of that technology in providing an improvement effect.
Definition at line 158 of file daicity.c.
Referenced by adjust_improvement_wants_by_effects(), and adjust_wants_for_reqs().