27#define FC_AI_MOD_CAPSTR "+Freeciv-3.3-ai-module-2023.Jul.18"
357#define ai_timer_init(...) (void) 0
358#define ai_timer_free(...) (void) 0
359#define ai_timer_start(...) (void) 0
360#define ai_timer_stop(...) (void) 0
361#define ai_timer_player_start(...) (void) 0
362#define ai_timer_player_stop(...) (void) 0
365#define ai_type_iterate(NAME_ai) \
368 int _aitotal_ = ai_type_get_count(); \
369 for (_aii_ = 0; _aii_ < _aitotal_ ; _aii_++) { \
370 struct ai_type *NAME_ai = get_ai_type(_aii_);
372#define ai_type_iterate_end \
377#define CALL_PLR_AI_FUNC(_func, _player, ...) \
379 struct player *_plr_ = _player; \
380 if (_plr_ && _plr_->ai && _plr_->ai->funcs._func) { \
381 ai_timer_player_start(_plr_); \
382 _plr_->ai->funcs._func( __VA_ARGS__ ); \
383 ai_timer_player_stop(_plr_); \
387#define CALL_FUNC_EACH_AI(_func, ...) \
389 ai_type_iterate(_ait_) { \
390 if (_ait_->funcs._func) { \
391 ai_timer_start(_ait_); \
392 _ait_->funcs._func( __VA_ARGS__ ); \
393 ai_timer_stop(_ait_); \
395 } ai_type_iterate_end; \
#define ai_timer_start(...)
void init_ai(struct ai_type *ai)
#define ai_timer_stop(...)
#define ai_timer_free(...)
const char * ai_name(const struct ai_type *ai)
#define ai_timer_player_start(...)
#define ai_timer_init(...)
struct ai_type * ai_type_alloc(void)
const char * ai_type_name_or_fallback(const char *orig_name)
struct ai_type * ai_type_by_name(const char *search)
int ai_type_get_count(void)
void ai_type_dealloc(void)
struct ai_type * get_ai_type(int id)
#define ai_timer_player_stop(...)
int ai_type_number(const struct ai_type *ai)
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit int const struct action *paction struct unit struct city * pcity
void(* revolution_start)(struct player *pplayer)
void(* log_fragment_unit)(char *buffer, int buflength, const struct unit *punit)
void(* reserved_02)(void)
void(* city_alloc)(struct city *pcity)
void(* created_by_civil_war)(struct player *original, struct player *created)
void(* consider_tile_dangerous)(struct tile *ptile, struct unit *punit, enum override_bool *result)
void(* unit_lost)(struct unit *punit)
void(* gov_value)(struct player *pplayer, struct government *gov, adv_want *val, bool *override)
void(* unit_transformed)(struct unit *punit, const struct unit_type *old_type)
void(* log_fragment_city)(char *buffer, int buflength, const struct city *pcity)
void(* settler_run)(struct player *pplayer, struct unit *punit, struct workermap *state)
void(* unit_load)(const struct section_file *file, struct unit *punit, const char *unitstr)
void(* unit_move)(struct unit *punit, struct tile *ptile, struct pf_path *path, int step)
void(* reserved_03)(void)
void(* unit_free)(struct unit *punit)
void(* phase_finished)(struct player *pplayer)
void(* tile_info)(struct tile *ptile)
void(* restart_phase)(struct player *pplayer)
void(* settler_reset)(struct player *pplayer)
void(* unit_save)(struct section_file *file, const struct unit *punit, const char *unitstr)
void(* refresh)(struct player *pplayer)
void(* treaty_evaluate)(struct player *pplayer, struct player *aplayer, struct treaty *ptreaty)
void(* unit_created)(struct unit *punit)
void(* units_ruleset_close)(void)
void(* city_destroyed)(struct city *pcity)
void(* diplomacy_actions)(struct player *pplayer)
void(* player_alloc)(struct player *pplayer)
void(* build_adv_prepare)(struct player *pplayer, struct adv_data *adv)
void(* build_adv_adjust_want)(struct player *pplayer, struct city *wonder_city)
void(* city_info)(struct city *pcity)
void(* player_load)(struct player *pplayer, const struct section_file *file, int plrno)
void(* build_adv_init)(struct player *pplayer)
void(* city_lost)(struct player *pplayer, struct city *pcity)
void(* unit_task)(struct unit *punit, enum adv_unit_task task, struct tile *ptile)
void(* reserved_01)(void)
void(* last_activities)(struct player *pplayer)
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(* first_contact)(struct player *pplayer, struct player *aplayer)
void(* city_created)(struct city *pcity)
void(* city_save)(struct section_file *file, const struct city *pcity, const char *citystr)
void(* consider_wonder_city)(struct city *pcity, bool *result)
struct ai_type::@15 funcs
void(* city_free)(struct city *pcity)
void(* choose_building)(struct city *pcity, struct adv_choice *choice)
void(* player_save_relations)(struct player *pplayer, struct player *other, struct section_file *file, int plrno)
void(* module_close)(void)
void(* city_load)(const struct section_file *file, struct city *pcity, const char *citystr)
void(* unit_destroyed)(struct unit *punit)
void(* player_load_relations)(struct player *pplayer, struct player *other, const struct section_file *file, int plrno)
void(* phase_begin)(struct player *pplayer, bool new_phase)
void(* player_free)(struct player *pplayer)
void(* split_by_civil_war)(struct player *original, struct player *created)
void(* unit_turn_end)(struct unit *punit)
void(* city_got)(struct player *pplayer, struct city *pcity)
void(* unit_alloc)(struct unit *punit)
void(* gained_control)(struct player *pplayer)
void(* unit_got)(struct unit *punit)
void(* player_console)(struct player *pplayer, const char *cmd)
void(* reserved_04)(void)
void(* player_save)(struct player *pplayer, struct section_file *file, int plrno)
void(* first_activities)(struct player *pplayer)
void(* consider_plr_dangerous)(struct player *plr1, struct player *plr2, enum override_bool *result)
void(* lost_control)(struct player *pplayer)
void(* treaty_accepted)(struct player *pplayer, struct player *aplayer, struct treaty *ptreaty)
void(* units_ruleset_init)(void)
void(* settler_cont)(struct player *pplayer, struct unit *punit, struct workermap *state)
void(* unit_move_seen)(struct unit *punit)
void(* reserved_05)(void)
void(* want_to_explore)(struct unit *punit, struct tile *target, enum override_bool *allow)