Freeciv-3.2: ai_type Struct Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Data Fields
ai_type Struct Reference

`#include <ai.h>`

## Data Fields

char | name [MAX_LEN_NAME]
void * | private
struct { |
void(* module_close )(void) |
void(* game_start )(void) |
void(* game_free )(void) |
void(* map_alloc )(void) |
void(* map_ready )(void) |
void(* map_free )(void) |
void(* player_alloc )(struct player *pplayer) |
void(* player_free )(struct player *pplayer) |
void(* player_save )(struct player *pplayer, struct section_file *file, int plrno) |
void(* player_load )(struct player *pplayer, const struct section_file *file, int plrno) |
void(* player_save_relations )(struct player *pplayer, struct player *other, struct section_file *file, int plrno) |
void(* player_load_relations )(struct player *pplayer, struct player *other, const struct section_file *file, int plrno) |
void(* player_console )(struct player *pplayer, const char *cmd) |
void(* gained_control )(struct player *pplayer) |
void(* lost_control )(struct player *pplayer) |
void(* split_by_civil_war )(struct player *original, struct player *created) |
void(* created_by_civil_war )(struct player *original, struct player *created) |
void(* phase_begin )(struct player *pplayer, bool new_phase) |
void(* phase_finished )(struct player *pplayer) |
void(* city_alloc )(struct city *pcity) |
void(* city_free )(struct city *pcity) |
void(* city_created )(struct city *pcity) |
void(* city_destroyed )(struct city *pcity) |
void(* city_got )(struct player *pplayer, struct city *pcity) |
void(* city_lost )(struct player *pplayer, struct city *pcity) |
void(* city_save )(struct section_file *file, const struct city *pcity, const char *citystr) |
void(* city_load )(const struct section_file *file, struct city *pcity, const char *citystr) |
void(* choose_building )(struct city *pcity, struct adv_choice *choice) |
void(* build_adv_prepare )(struct player *pplayer, struct adv_data *adv) |
void(* build_adv_init )(struct player *pplayer) |
void(* build_adv_adjust_want )(struct player *pplayer, struct city *wonder_city) |
void(* gov_value )(struct player *pplayer, struct government *gov, adv_want *val, bool *override) |
void(* units_ruleset_init )(void) |
void(* units_ruleset_close )(void) |
void(* unit_alloc )(struct unit *punit) |
void(* unit_free )(struct unit *punit) |
void(* unit_created )(struct unit *punit) |
void(* unit_destroyed )(struct unit *punit) |
void(* unit_got )(struct unit *punit) |
void(* unit_transformed )(struct unit *punit, const struct unit_type *old_type) |
void(* unit_lost )(struct unit *punit) |
void(* unit_turn_end )(struct unit *punit) |
void(* unit_move )(struct unit *punit, struct tile *ptile, struct pf_path *path, int step) |
void(* unit_move_seen )(struct unit *punit) |
void(* unit_task )(struct unit *punit, enum adv_unit_task task, struct tile *ptile) |
void(* unit_save )(struct section_file *file, const struct unit *punit, const char *unitstr) |
void(* unit_load )(const struct section_file *file, struct unit *punit, const char *unitstr) |
void(* settler_reset )(struct player *pplayer) |
void(* settler_run )(struct player *pplayer, struct unit *punit, struct settlermap *state) |
void(* settler_cont )(struct player *pplayer, struct unit *punit, struct settlermap *state) |
void(* want_to_explore )(struct unit *punit, struct tile *target, enum override_bool *allow) |
void(* first_activities )(struct player *pplayer) |
void(* restart_phase )(struct player *pplayer) |
void(* diplomacy_actions )(struct player *pplayer) |
void(* last_activities )(struct player *pplayer) |
void(* treaty_evaluate )(struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty) |
void(* treaty_accepted )(struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty) |
void(* first_contact )(struct player *pplayer, struct player *aplayer) |

void(* incident )(enum incident_type type,
enum casus_belli_range scope,
const struct action *paction,
struct player *receiver,
struct player *violator,
struct player *victim)

void(* log_fragment_city )(char *buffer, int buflength, const struct city *pcity) |
void(* log_fragment_unit )(char *buffer, int buflength, const struct unit *punit) |
void(* consider_plr_dangerous )(struct player *plr1, struct player *plr2, enum override_bool *result) |
void(* consider_tile_dangerous )(struct tile *ptile, struct unit *punit, enum override_bool *result) |
void(* consider_wonder_city )(struct city *pcity, bool *result) |
void(* refresh )(struct player *pplayer) |
void(* tile_info )(struct tile *ptile) |
void(* city_info )(struct city *pcity) |
void(* unit_info )(struct unit *punit) |
void(* reserved_01 )(void) |
void(* reserved_02 )(void) |
void(* reserved_03 )(void) |
void(* reserved_04 )(void) |
void(* reserved_05 )(void) |
} | funcs |

## Detailed Description

Definition at line 49 of file ai.h.

## Field Documentation

## ◆ build_adv_adjust_want

void(* ai_type::build_adv_adjust_want) (struct player *pplayer, struct city *wonder_city)

Definition at line 170 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ build_adv_init

void(* ai_type::build_adv_init) (struct player *pplayer)

Definition at line 165 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ build_adv_prepare

void(* ai_type::build_adv_prepare) (struct player *pplayer, struct adv_data *adv)

Definition at line 161 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ choose_building

void(* ai_type::choose_building) (struct city *pcity, struct adv_choice *choice)

Definition at line 158 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ city_alloc

void(* ai_type::city_alloc) (struct city *pcity)

Definition at line 128 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ city_created

void(* ai_type::city_created) (struct city *pcity)

Definition at line 136 of file ai.h.

Referenced by fc_ai_tex_setup().

## ◆ city_destroyed

void(* ai_type::city_destroyed) (struct city *pcity)

Definition at line 140 of file ai.h.

Referenced by fc_ai_tex_setup().

## ◆ city_free

void(* ai_type::city_free) (struct city *pcity)

Definition at line 132 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ city_got

void(* ai_type::city_got) (struct player *pplayer, struct city *pcity)

Definition at line 143 of file ai.h.

## ◆ city_info

void(* ai_type::city_info) (struct city *pcity)

Definition at line 311 of file ai.h.

Referenced by fc_ai_tex_setup().

## ◆ city_load

void(* ai_type::city_load) (const struct section_file *file, struct city *pcity, const char *citystr)

Definition at line 153 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ city_lost

void(* ai_type::city_lost) (struct player *pplayer, struct city *pcity)

Definition at line 146 of file ai.h.

## ◆ city_save

void(* ai_type::city_save) (struct section_file *file, const struct city *pcity, const char *citystr)

Definition at line 149 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ consider_plr_dangerous

void(* ai_type::consider_plr_dangerous) (struct player *plr1, struct player *plr2, enum override_bool *result)

Definition at line 290 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ consider_tile_dangerous

void(* ai_type::consider_tile_dangerous) (struct tile *ptile, struct unit *punit, enum override_bool *result)

Definition at line 294 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ consider_wonder_city

void(* ai_type::consider_wonder_city) (struct city *pcity, bool *result)

Definition at line 299 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ created_by_civil_war

void(* ai_type::created_by_civil_war) (struct player *original, struct player *created)

Definition at line 117 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ diplomacy_actions

void(* ai_type::diplomacy_actions) (struct player *pplayer)

Definition at line 254 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ first_activities

void(* ai_type::first_activities) (struct player *pplayer)

Definition at line 247 of file ai.h.

Referenced by fc_ai_classic_setup(), fc_ai_stub_setup(), and fc_ai_tex_setup().

## ◆ first_contact

void(* ai_type::first_contact) (struct player *pplayer, struct player *aplayer)

Definition at line 272 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ [struct]

struct { ... } ai_type::funcs

Referenced by aicmd_command(), fc_ai_classic_setup(), fc_ai_stub_setup(), and fc_ai_tex_setup().

## ◆ gained_control

void(* ai_type::gained_control) (struct player *pplayer)

Definition at line 108 of file ai.h.

Referenced by create_command_pregame(), fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ game_free

void(* ai_type::game_free) (void)

Definition at line 64 of file ai.h.

## ◆ game_start

void(* ai_type::game_start) (void)

Definition at line 61 of file ai.h.

## ◆ gov_value

void(* ai_type::gov_value) (struct player *pplayer, struct government *gov, adv_want *val, bool *override)

Definition at line 173 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ incident

void(* ai_type::incident) (enum incident_type type, enum casus_belli_range scope, const struct action *paction, struct player *receiver, struct player *violator, struct player *victim)

Definition at line 276 of file ai.h.

Referenced by call_incident(), fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ last_activities

void(* ai_type::last_activities) (struct player *pplayer)

Definition at line 257 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ log_fragment_city

void(* ai_type::log_fragment_city) (char *buffer, int buflength, const struct city *pcity)

Definition at line 283 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ log_fragment_unit

void(* ai_type::log_fragment_unit) (char *buffer, int buflength, const struct unit *punit)

Definition at line 287 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ lost_control

void(* ai_type::lost_control) (struct player *pplayer)

Definition at line 111 of file ai.h.

Referenced by fc_ai_tex_setup().

## ◆ map_alloc

void(* ai_type::map_alloc) (void)

Definition at line 67 of file ai.h.

Referenced by fc_ai_tex_setup().

## ◆ map_free

void(* ai_type::map_free) (void)

Definition at line 74 of file ai.h.

Referenced by fc_ai_tex_setup().

## ◆ map_ready

void(* ai_type::map_ready) (void)

Definition at line 71 of file ai.h.

Referenced by fc_ai_tex_setup().

## ◆ module_close

void(* ai_type::module_close) (void)

Definition at line 57 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ name

char ai_type::name[MAX_LEN_NAME]

Definition at line 51 of file ai.h.

Referenced by ai_name(), audio_none_init(), audio_sdl_init(), cma_init(), cmafec_init(), default_ai_type_name(), fc_ai_classic_setup(), fc_ai_stub_setup(), fc_ai_tex_setup(), simple_historian_init(), tolua_get_City_City_name(), and tolua_get_Player_Player_name().

## ◆ phase_begin

void(* ai_type::phase_begin) (struct player *pplayer, bool new_phase)

Definition at line 121 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ phase_finished

void(* ai_type::phase_finished) (struct player *pplayer)

Definition at line 124 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ player_alloc

void(* ai_type::player_alloc) (struct player *pplayer)

Definition at line 77 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ player_console

void(* ai_type::player_console) (struct player *pplayer, const char *cmd)

Definition at line 105 of file ai.h.

Referenced by aicmd_command().

## ◆ player_free

void(* ai_type::player_free) (struct player *pplayer)

Definition at line 80 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ player_load

void(* ai_type::player_load) (struct player *pplayer, const struct section_file *file, int plrno)

Definition at line 87 of file ai.h.

Referenced by fc_ai_tex_setup().

## ◆ player_load_relations

void(* ai_type::player_load_relations) (struct player *pplayer, struct player *other, const struct section_file *file, int plrno)

Definition at line 101 of file ai.h.

Referenced by fc_ai_classic_setup().

## ◆ player_save

void(* ai_type::player_save) (struct player *pplayer, struct section_file *file, int plrno)

Definition at line 83 of file ai.h.

Referenced by fc_ai_tex_setup().

## ◆ player_save_relations

void(* ai_type::player_save_relations) (struct player *pplayer, struct player *other, struct section_file *file, int plrno)

Definition at line 96 of file ai.h.

Referenced by fc_ai_classic_setup().

## ◆ private

void* ai_type::private

Definition at line 53 of file ai.h.

Referenced by cai_module_close(), contemplate_terrain_improvements(), fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ refresh

void(* ai_type::refresh) (struct player *pplayer)

Definition at line 302 of file ai.h.

Referenced by call_ai_refresh(), and fc_ai_tex_setup().

## ◆ reserved_01

void(* ai_type::reserved_01) (void)

Definition at line 327 of file ai.h.

## ◆ reserved_02

void(* ai_type::reserved_02) (void)

Definition at line 328 of file ai.h.

## ◆ reserved_03

void(* ai_type::reserved_03) (void)

Definition at line 329 of file ai.h.

## ◆ reserved_04

void(* ai_type::reserved_04) (void)

Definition at line 330 of file ai.h.

## ◆ reserved_05

void(* ai_type::reserved_05) (void)

Definition at line 331 of file ai.h.

## ◆ restart_phase

void(* ai_type::restart_phase) (struct player *pplayer)

Definition at line 250 of file ai.h.

Referenced by fc_ai_classic_setup(), fc_ai_stub_setup(), and fc_ai_tex_setup().

## ◆ settler_cont

void(* ai_type::settler_cont) (struct player *pplayer, struct unit *punit, struct settlermap *state)

Definition at line 238 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ settler_reset

void(* ai_type::settler_reset) (struct player *pplayer)

Definition at line 230 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ settler_run

void(* ai_type::settler_run) (struct player *pplayer, struct unit *punit, struct settlermap *state)

Definition at line 233 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ split_by_civil_war

void(* ai_type::split_by_civil_war) (struct player *original, struct player *created)

Definition at line 114 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ tile_info

void(* ai_type::tile_info) (struct tile *ptile)

Definition at line 305 of file ai.h.

Referenced by fc_ai_tex_setup().

## ◆ treaty_accepted

void(* ai_type::treaty_accepted) (struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty)

Definition at line 265 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ treaty_evaluate

void(* ai_type::treaty_evaluate) (struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty)

Definition at line 260 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ unit_alloc

void(* ai_type::unit_alloc) (struct unit *punit)

Definition at line 184 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ unit_created

void(* ai_type::unit_created) (struct unit *punit)

Definition at line 192 of file ai.h.

Referenced by fc_ai_tex_setup().

## ◆ unit_destroyed

void(* ai_type::unit_destroyed) (struct unit *punit)

Definition at line 196 of file ai.h.

Referenced by fc_ai_tex_setup().

## ◆ unit_free

void(* ai_type::unit_free) (struct unit *punit)

Definition at line 188 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ unit_got

void(* ai_type::unit_got) (struct unit *punit)

Definition at line 199 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ unit_info

void(* ai_type::unit_info) (struct unit *punit)

Definition at line 317 of file ai.h.

Referenced by fc_ai_tex_setup().

## ◆ unit_load

void(* ai_type::unit_load) (const struct section_file *file, struct unit *punit, const char *unitstr)

Definition at line 226 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ unit_lost

void(* ai_type::unit_lost) (struct unit *punit)

Definition at line 205 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ unit_move

void(* ai_type::unit_move) (struct unit *punit, struct tile *ptile, struct pf_path *path, int step)

Definition at line 211 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ unit_move_seen

void(* ai_type::unit_move_seen) (struct unit *punit)

Definition at line 215 of file ai.h.

Referenced by fc_ai_tex_setup().

## ◆ unit_save

void(* ai_type::unit_save) (struct section_file *file, const struct unit *punit, const char *unitstr)

Definition at line 222 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ unit_task

void(* ai_type::unit_task) (struct unit *punit, enum adv_unit_task task, struct tile *ptile)

Definition at line 218 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ unit_transformed

void(* ai_type::unit_transformed) (struct unit *punit, const struct unit_type *old_type)

Definition at line 202 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ unit_turn_end

void(* ai_type::unit_turn_end) (struct unit *punit)

Definition at line 208 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ units_ruleset_close

void(* ai_type::units_ruleset_close) (void)

Definition at line 180 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ units_ruleset_init

void(* ai_type::units_ruleset_init) (void)

Definition at line 177 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().

## ◆ want_to_explore

void(* ai_type::want_to_explore) (struct unit *punit, struct tile *target, enum override_bool *allow)

Definition at line 242 of file ai.h.

Referenced by fc_ai_classic_setup(), and fc_ai_tex_setup().