![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include "ai.h"#include "player.h"#include "advdata.h"#include "autosettlers.h"#include "aidata.h"#include "aiferry.h"#include "aihand.h"#include "ailog.h"#include "aiplayer.h"#include "aisettler.h"#include "aitools.h"#include "aiunit.h"#include "daicity.h"#include "daidiplomacy.h"#include "daidomestic.h"#include "daimilitary.h"#include "classicai.h"
Include dependency graph for classicai.cpp:Go to the source code of this file.
Functions | |
| static void | classic_ai_set_self (struct ai_type *ai) |
| Set pointer to ai type of the classic ai. More... | |
| static struct ai_type * | classic_ai_get_self () |
| Get pointer to ai type of the classic ai. More... | |
| static void | cai_module_close () |
| Free resources allocated by the classic AI module. More... | |
| static void | cai_player_alloc (struct player *pplayer) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_player_free (struct player *pplayer) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_player_save_relations (struct player *pplayer, struct player *other, struct section_file *file, int plrno) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_player_load_relations (struct player *pplayer, struct player *other, const struct section_file *file, int plrno) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_gained_control (struct player *pplayer) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_split_by_civil_war (struct player *original, struct player *created) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_created_by_civil_war (struct player *original, struct player *created) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_data_phase_begin (struct player *pplayer, bool is_new_phase) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_data_phase_finished (struct player *pplayer) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_city_alloc (struct city *pcity) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_city_free (struct city *pcity) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_city_save (struct section_file *file, const struct city *pcity, const char *citystr) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_city_load (const struct section_file *file, struct city *pcity, const char *citystr) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_build_adv_override (struct city *pcity, struct adv_choice *choice) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_wonder_city_distance (struct player *pplayer, struct adv_data *adv) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_build_adv_init (struct player *pplayer) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_build_adv_adjust (struct player *pplayer, struct city *wonder_city) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_gov_value (struct player *pplayer, struct government *gov, adv_want *val, bool *override) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_units_ruleset_init () |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_units_ruleset_close () |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_unit_init (struct unit *punit) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_unit_close (struct unit *punit) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_ferry_init_ferry (struct unit *ferry) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_ferry_transformed (struct unit *ferry, const struct unit_type *old) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_ferry_lost (struct unit *punit) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_unit_turn_end (struct unit *punit) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_unit_move_or_attack (struct unit *punit, struct tile *ptile, const PFPath &path, int step) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_unit_new_adv_task (struct unit *punit, enum adv_unit_task task, struct tile *ptile) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_unit_save (struct section_file *file, const struct unit *punit, const char *unitstr) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_unit_load (const struct section_file *file, struct unit *punit, const char *unitstr) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_auto_settler_reset (struct player *pplayer) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_auto_settler_run (struct player *pplayer, struct unit *punit, struct settlermap *state) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_auto_settler_cont (struct player *pplayer, struct unit *punit, struct settlermap *state) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_switch_to_explore (struct unit *punit, struct tile *target, enum override_bool *allow) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_do_first_activities (struct player *pplayer) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_restart_phase (struct player *pplayer) |
| Mark turn done as we have already done everything before game was saved. More... | |
| static void | cai_diplomacy_actions (struct player *pplayer) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_do_last_activities (struct player *pplayer) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_treaty_evaluate (struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_treaty_accepted (struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_diplomacy_first_contact (struct player *pplayer, struct player *aplayer) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_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 classic ai type as parameter. More... | |
| static void | cai_city_log (char *buffer, int buflength, const struct city *pcity) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_unit_log (char *buffer, int buflength, const struct unit *punit) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_consider_plr_dangerous (struct player *plr1, struct player *plr2, enum override_bool *result) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_consider_tile_dangerous (struct tile *ptile, struct unit *punit, enum override_bool *result) |
| Call default ai with classic ai type as parameter. More... | |
| static void | cai_consider_wonder_city (struct city *pcity, bool *result) |
| Call default ai with classic ai type as parameter. More... | |
| bool | fc_ai_classic_setup (struct ai_type *ai) |
| Setup player ai_funcs function pointers. More... | |
Variables | |
| static struct ai_type * | self = nullptr |
|
static |
Call default ai with classic ai type as parameter.
Definition at line 406 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 385 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 395 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
Call default ai with classic ai type as parameter.
Definition at line 237 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 227 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 205 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 163 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 173 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 194 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 517 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 183 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 539 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 551 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 563 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
Call default ai with classic ai type as parameter.
Definition at line 132 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 143 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 153 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 448 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
Call default ai with classic ai type as parameter.
Definition at line 492 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 428 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 458 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 299 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 320 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
Call default ai with classic ai type as parameter.
Definition at line 309 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 111 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 248 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 503 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Free resources allocated by the classic AI module.
Definition at line 55 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 65 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 75 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 98 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Classicai stores information to "ai" like the default ai common code.
Definition at line 86 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Mark turn done as we have already done everything before game was saved.
Definition at line 440 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
Call default ai with classic ai type as parameter.
Definition at line 121 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 417 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 480 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 468 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 289 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 279 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 374 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 528 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 340 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 351 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 363 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 330 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 269 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Call default ai with classic ai type as parameter.
Definition at line 259 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
Call default ai with classic ai type as parameter.
Definition at line 216 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
|
static |
Get pointer to ai type of the classic ai.
Definition at line 50 of file classicai.cpp.
Referenced by cai_auto_settler_cont(), cai_auto_settler_reset(), cai_auto_settler_run(), cai_build_adv_adjust(), cai_build_adv_init(), cai_build_adv_override(), cai_city_alloc(), cai_city_free(), cai_city_load(), cai_city_log(), cai_city_save(), cai_consider_plr_dangerous(), cai_consider_tile_dangerous(), cai_consider_wonder_city(), cai_created_by_civil_war(), cai_data_phase_begin(), cai_data_phase_finished(), cai_diplomacy_actions(), cai_diplomacy_first_contact(), cai_do_first_activities(), cai_do_last_activities(), cai_ferry_init_ferry(), cai_ferry_lost(), cai_ferry_transformed(), cai_gained_control(), cai_gov_value(), cai_incident(), cai_module_close(), cai_player_alloc(), cai_player_free(), cai_player_load_relations(), cai_player_save_relations(), cai_split_by_civil_war(), cai_switch_to_explore(), cai_treaty_accepted(), cai_treaty_evaluate(), cai_unit_close(), cai_unit_init(), cai_unit_load(), cai_unit_log(), cai_unit_move_or_attack(), cai_unit_new_adv_task(), cai_unit_save(), cai_unit_turn_end(), cai_units_ruleset_close(), cai_units_ruleset_init(), and cai_wonder_city_distance().
|
static |
Set pointer to ai type of the classic ai.
Definition at line 45 of file classicai.cpp.
Referenced by fc_ai_classic_setup().
| bool fc_ai_classic_setup | ( | struct ai_type * | ai | ) |
Setup player ai_funcs function pointers.
Definition at line 573 of file classicai.cpp.
Referenced by ai_init().
|
static |
Definition at line 40 of file classicai.cpp.
Referenced by api_methods_city_inspire_partisans(), audio_none_init(), and audio_sdl_init().