Freeciv21
Develop your civilization from humble roots to a global empire
ai_type Struct Reference

#include <ai.h>

Public Attributes

char name [MAX_LEN_NAME]
 
void * pprivate
 
struct {
   void(*   module_close )()
 
   void(*   game_start )()
 
   void(*   game_free )()
 
   void(*   map_alloc )()
 
   void(*   map_ready )()
 
   void(*   map_free )()
 
   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(*   units_ruleset_close )()
 
   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, const PFPath
      &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(*   reserved_02 )()
 
   void(*   reserved_03 )()
 
   void(*   reserved_04 )()
 
   void(*   reserved_05 )()
 
funcs
 

Detailed Description

Definition at line 42 of file ai.h.

Member Data Documentation

◆ build_adv_adjust_want

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

Definition at line 168 of file ai.h.

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

◆ build_adv_init

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

Definition at line 163 of file ai.h.

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

◆ build_adv_prepare

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

Definition at line 159 of file ai.h.

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

◆ choose_building

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

Definition at line 155 of file ai.h.

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

◆ city_alloc

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

Definition at line 125 of file ai.h.

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

◆ city_created

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

Definition at line 133 of file ai.h.

Referenced by fc_ai_tex_setup().

◆ city_destroyed

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

Definition at line 137 of file ai.h.

Referenced by fc_ai_tex_setup().

◆ city_free

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

Definition at line 129 of file ai.h.

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

◆ city_got

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

Definition at line 140 of file ai.h.

◆ city_info

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

Definition at line 318 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 150 of file ai.h.

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

◆ city_lost

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

Definition at line 143 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 146 of file ai.h.

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

◆ consider_plr_dangerous

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

Definition at line 296 of file ai.h.

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

◆ consider_tile_dangerous

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

Definition at line 301 of file ai.h.

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

◆ consider_wonder_city

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

Definition at line 306 of file ai.h.

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

◆ created_by_civil_war

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

Definition at line 113 of file ai.h.

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

◆ diplomacy_actions

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

Definition at line 258 of file ai.h.

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

◆ first_activities

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

Definition at line 250 of file ai.h.

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

◆ first_contact

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

Definition at line 277 of file ai.h.

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

◆ 

◆ gained_control

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

Definition at line 103 of file ai.h.

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

◆ game_free

void(* ai_type::game_free) ()

Definition at line 56 of file ai.h.

◆ game_start

void(* ai_type::game_start) ()

Definition at line 53 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 172 of file ai.h.

Referenced by fc_ai_classic_setup(), fc_ai_tex_setup(), and fc_ai_threaded_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 281 of file ai.h.

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

◆ last_activities

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

Definition at line 261 of file ai.h.

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

◆ log_fragment_city

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

Definition at line 287 of file ai.h.

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

◆ log_fragment_unit

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

Definition at line 292 of file ai.h.

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

◆ lost_control

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

Definition at line 106 of file ai.h.

Referenced by fc_ai_tex_setup(), and fc_ai_threaded_setup().

◆ map_alloc

void(* ai_type::map_alloc) ()

Definition at line 59 of file ai.h.

Referenced by fc_ai_tex_setup().

◆ map_free

void(* ai_type::map_free) ()

Definition at line 66 of file ai.h.

Referenced by fc_ai_tex_setup().

◆ map_ready

void(* ai_type::map_ready) ()

Definition at line 63 of file ai.h.

Referenced by fc_ai_tex_setup().

◆ module_close

void(* ai_type::module_close) ()

Definition at line 49 of file ai.h.

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

◆ name

◆ phase_begin

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

Definition at line 118 of file ai.h.

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

◆ phase_finished

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

Definition at line 121 of file ai.h.

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

◆ player_alloc

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

Definition at line 69 of file ai.h.

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

◆ player_console

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

Definition at line 100 of file ai.h.

Referenced by aicmd_command().

◆ player_free

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

Definition at line 72 of file ai.h.

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

◆ player_load

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

Definition at line 79 of file ai.h.

Referenced by fc_ai_tex_setup(), and fc_ai_threaded_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 94 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 75 of file ai.h.

Referenced by fc_ai_tex_setup(), and fc_ai_threaded_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 88 of file ai.h.

Referenced by fc_ai_classic_setup().

◆ pprivate

void* ai_type::pprivate

Definition at line 45 of file ai.h.

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

◆ refresh

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

Definition at line 309 of file ai.h.

Referenced by call_ai_refresh(), fc_ai_tex_setup(), and fc_ai_threaded_setup().

◆ reserved_01

void(* ai_type::reserved_01) ()

Definition at line 334 of file ai.h.

◆ reserved_02

void(* ai_type::reserved_02) ()

Definition at line 335 of file ai.h.

◆ reserved_03

void(* ai_type::reserved_03) ()

Definition at line 336 of file ai.h.

◆ reserved_04

void(* ai_type::reserved_04) ()

Definition at line 337 of file ai.h.

◆ reserved_05

void(* ai_type::reserved_05) ()

Definition at line 338 of file ai.h.

◆ restart_phase

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

Definition at line 254 of file ai.h.

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

◆ settler_cont

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

Definition at line 240 of file ai.h.

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

◆ settler_reset

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

Definition at line 232 of file ai.h.

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

◆ settler_run

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

Definition at line 235 of file ai.h.

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

◆ split_by_civil_war

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

Definition at line 109 of file ai.h.

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

◆ tile_info

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

Definition at line 312 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 270 of file ai.h.

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

◆ treaty_evaluate

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

Definition at line 265 of file ai.h.

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

◆ unit_alloc

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

Definition at line 183 of file ai.h.

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

◆ unit_created

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

Definition at line 191 of file ai.h.

Referenced by fc_ai_tex_setup().

◆ unit_destroyed

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

Definition at line 195 of file ai.h.

Referenced by fc_ai_tex_setup().

◆ unit_free

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

Definition at line 187 of file ai.h.

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

◆ unit_got

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

Definition at line 198 of file ai.h.

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

◆ unit_info

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

Definition at line 324 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 227 of file ai.h.

Referenced by fc_ai_classic_setup(), fc_ai_tex_setup(), and fc_ai_threaded_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(), fc_ai_tex_setup(), and fc_ai_threaded_setup().

◆ unit_move

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

Definition at line 211 of file ai.h.

Referenced by fc_ai_classic_setup(), fc_ai_tex_setup(), and fc_ai_threaded_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 223 of file ai.h.

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

◆ unit_task

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

Definition at line 219 of file ai.h.

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

◆ unit_transformed

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

Definition at line 201 of file ai.h.

Referenced by fc_ai_classic_setup(), fc_ai_tex_setup(), and fc_ai_threaded_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(), fc_ai_tex_setup(), and fc_ai_threaded_setup().

◆ units_ruleset_close

void(* ai_type::units_ruleset_close) ()

Definition at line 179 of file ai.h.

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

◆ units_ruleset_init

void(* ai_type::units_ruleset_init) ()

Definition at line 176 of file ai.h.

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

◆ want_to_explore

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

Definition at line 245 of file ai.h.

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