![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include <fc_config.h>#include "ai.h"#include "aidata.h"#include "aiferry.h"#include "aihand.h"#include "ailog.h"#include "aiplayer.h"#include "aisettler.h"#include "aitools.h"#include "daicity.h"#include "daidiplomacy.h"#include "daidomestic.h"#include "daimilitary.h"#include "taimsg.h"#include "taiplayer.h"
Include dependency graph for threadedai.c:Go to the source code of this file.
Macros | |
| #define | TAI_AIT struct ai_type *ait = tai_get_self(); |
| #define | TAI_TFUNC(_func, ...) _func(ait, ##__VA_ARGS__); |
| #define | TAI_DFUNC(_func, ...) _func(ait, ##__VA_ARGS__); |
Functions | |
| const char * | fc_ai_threaded_capstr (void) |
| Return module capability string. More... | |
| bool | fc_ai_threaded_setup (struct ai_type *ai) |
| Setup player ai_funcs function pointers. More... | |
| static void | tai_init_self (struct ai_type *ai) |
| Set pointer to ai type of the threaded ai. More... | |
| static struct ai_type * | tai_get_self (void) |
| Get pointer to ai type of the threaded ai. More... | |
| static void | tai_module_close (void) |
| Free resources allocated by the threaded AI module. More... | |
| static void | twai_player_alloc (struct player *pplayer) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_player_free (struct player *pplayer) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_player_save (struct player *pplayer, struct section_file *file, int plrno) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_player_load (struct player *pplayer, const struct section_file *file, int plrno) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_control_gained (struct player *pplayer) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_control_lost (struct player *pplayer) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_split_by_civil_war (struct player *original, struct player *created) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_created_by_civil_war (struct player *original, struct player *created) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_phase_begin (struct player *pplayer, bool is_new_phase) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_phase_finished (struct player *pplayer) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_city_alloc (struct city *pcity) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_city_free (struct city *pcity) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_city_save (struct section_file *file, const struct city *pcity, const char *citystr) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_city_load (const struct section_file *file, struct city *pcity, const char *citystr) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_build_adv_override (struct city *pcity, struct adv_choice *choice) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_wonder_city_distance (struct player *pplayer, struct adv_data *adv) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_build_adv_init (struct player *pplayer) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_build_adv_adjust (struct player *pplayer, struct city *wonder_city) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_gov_value (struct player *pplayer, struct government *gov, adv_want *val, bool *override) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_units_ruleset_init (void) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_units_ruleset_close (void) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_unit_alloc (struct unit *punit) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_unit_free (struct unit *punit) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_ferry_init_ferry (struct unit *ferry) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_ferry_transformed (struct unit *ferry, const struct unit_type *old) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_ferry_lost (struct unit *punit) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_unit_turn_end (struct unit *punit) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_unit_move_or_attack (struct unit *punit, struct tile *ptile, struct pf_path *path, int step) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_unit_new_adv_task (struct unit *punit, enum adv_unit_task task, struct tile *ptile) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_unit_save (struct section_file *file, const struct unit *punit, const char *unitstr) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_unit_load (const struct section_file *file, struct unit *punit, const char *unitstr) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_auto_settler_reset (struct player *pplayer) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_auto_settler_run (struct player *pplayer, struct unit *punit, struct settlermap *state) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_auto_settler_cont (struct player *pplayer, struct unit *punit, struct settlermap *state) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_switch_to_explore (struct unit *punit, struct tile *target, enum override_bool *allow) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_first_activities (struct player *pplayer) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_restart_phase (struct player *pplayer) |
| Start working on the thread again. More... | |
| static void | twai_diplomacy_actions (struct player *pplayer) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_last_activities (struct player *pplayer) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_treaty_evaluate (struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_treaty_accepted (struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_diplomacy_first_contact (struct player *pplayer, struct player *aplayer) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_incident (enum incident_type type, enum casus_belli_range scope, const struct action *paction, struct player *receiver, struct player *violator, struct player *victim) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_city_log (char *buffer, int buflength, const struct city *pcity) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_unit_log (char *buffer, int buflength, const struct unit *punit) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_consider_plr_dangerous (struct player *plr1, struct player *plr2, enum override_bool *result) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_consider_tile_dangerous (struct tile *ptile, struct unit *punit, enum override_bool *result) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_consider_wonder_city (struct city *pcity, bool *result) |
| Call default ai with threaded ai type as parameter. More... | |
| static void | twai_refresh (struct player *pplayer) |
| Call default ai with threaded ai type as parameter. More... | |
Variables | |
| static struct ai_type * | self = NULL |
| #define TAI_AIT struct ai_type *ait = tai_get_self(); |
Definition at line 59 of file threadedai.c.
| #define TAI_DFUNC | ( | _func, | |
| ... | |||
| ) | _func(ait, ##__VA_ARGS__); |
Definition at line 61 of file threadedai.c.
| #define TAI_TFUNC | ( | _func, | |
| ... | |||
| ) | _func(ait, ##__VA_ARGS__); |
Definition at line 60 of file threadedai.c.
| const char * fc_ai_threaded_capstr | ( | void | ) |
Return module capability string.
Definition at line 558 of file threadedai.c.
| bool fc_ai_threaded_setup | ( | struct ai_type * | ai | ) |
Setup player ai_funcs function pointers.
Definition at line 563 of file threadedai.c.
Referenced by ai_init().
|
static |
Get pointer to ai type of the threaded ai.
Definition at line 57 of file threadedai.c.
|
static |
Set pointer to ai type of the threaded ai.
Definition at line 47 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Free resources allocated by the threaded AI module.
Definition at line 66 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 395 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 376 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 385 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
Call default ai with threaded ai type as parameter.
Definition at line 242 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 233 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 213 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 175 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 184 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 203 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 498 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 193 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 518 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 529 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 540 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 117 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 127 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
Call default ai with threaded ai type as parameter.
Definition at line 146 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 435 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 475 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 298 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 317 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
Call default ai with threaded ai type as parameter.
Definition at line 307 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 416 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 252 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 485 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 444 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 156 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 165 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 77 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 87 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 107 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 97 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 549 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Start working on the thread again.
Definition at line 426 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
Call default ai with threaded ai type as parameter.
Definition at line 136 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 406 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 464 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 453 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 280 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 289 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 366 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 508 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 335 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 345 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 356 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 326 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 271 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Call default ai with threaded ai type as parameter.
Definition at line 262 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
Call default ai with threaded ai type as parameter.
Definition at line 223 of file threadedai.c.
Referenced by fc_ai_threaded_setup().
|
static |
Definition at line 42 of file threadedai.c.