Freeciv-3.3
Loading...
Searching...
No Matches
texai.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* common */
19#include "ai.h"
20#include "world_object.h"
21
22/* ai/default */
23#include "aiferry.h"
24#include "aihand.h"
25#include "daicity.h"
26#include "daidiplomacy.h"
27#include "daidomestic.h"
28#include "dailog.h"
29#include "daimilitary.h"
30#include "daiplayer.h"
31#include "daisettler.h"
32#include "daitools.h"
33#include "daiunit.h"
34
35/* tex ai */
36#include "texaicity.h"
37#include "texaimsg.h"
38#include "texaiplayer.h"
39#include "texaiworld.h"
40
41const char *fc_ai_tex_capstr(void);
42bool fc_ai_tex_setup(struct ai_type *ai);
43
44static void texai_init_self(struct ai_type *ai);
45
46static struct ai_type *self = NULL;
47
48/**********************************************************************/
51static void texai_init_self(struct ai_type *ai)
52{
53 self = ai;
54
56}
57
58/**********************************************************************/
62{
63 return self;
64}
65
66#define TEXAI_AIT struct ai_type *ait = texai_get_self();
67#define TEXAI_TFUNC(_func, ...) _func(ait, ## __VA_ARGS__ );
68#define TEXAI_DFUNC(_func, ...) _func(ait, ## __VA_ARGS__ );
69
70/**********************************************************************/
73static void texai_module_close(void)
74{
76
77 FC_FREE(ait->private);
78}
79
80/**********************************************************************/
83static void texwai_player_alloc(struct player *pplayer)
84{
87 /* Do not call default AI here, texai_player_alloc() does necessary parts */
88}
89
90/**********************************************************************/
93static void texwai_player_free(struct player *pplayer)
94{
97 /* Do not call default AI here, texai_player_free() does necessary parts */
98}
99
100/**********************************************************************/
103static void texwai_player_save(struct player *pplayer,
104 struct section_file *file, int plrno)
105{
106 TEXAI_AIT;
107 TEXAI_DFUNC(dai_player_save, "texai", pplayer, file, plrno);
108}
109
110/**********************************************************************/
113static void texwai_player_load(struct player *pplayer,
114 const struct section_file *file,
115 int plrno)
116{
117 TEXAI_AIT;
118 TEXAI_DFUNC(dai_player_load, "texai", pplayer, file, plrno);
119}
120
121/**********************************************************************/
124static void texwai_control_gained(struct player *pplayer)
125{
126 TEXAI_AIT;
129}
130
131/**********************************************************************/
134static void texwai_control_lost(struct player *pplayer)
135{
136 TEXAI_AIT;
138}
139
140/**********************************************************************/
143static void texwai_split_by_civil_war(struct player *original,
144 struct player *created)
145{
146 TEXAI_AIT;
148}
149
150/**********************************************************************/
153static void texwai_created_by_civil_war(struct player *original,
154 struct player *created)
155{
156 TEXAI_AIT;
158}
159
160/**********************************************************************/
163static void texwai_phase_begin(struct player *pplayer, bool is_new_phase)
164{
165 TEXAI_AIT;
167}
168
169/**********************************************************************/
172static void texwai_phase_finished(struct player *pplayer)
173{
174 TEXAI_AIT;
177}
178
179/**********************************************************************/
182static void texwai_city_alloc(struct city *pcity)
183{
184 TEXAI_AIT;
186}
187
188/**********************************************************************/
191static void texwai_city_free(struct city *pcity)
192{
193 TEXAI_AIT;
195}
196
197/**********************************************************************/
200static void texwai_city_save(struct section_file *file,
201 const struct city *pcity, const char *citystr)
202{
203 TEXAI_AIT;
204 TEXAI_DFUNC(dai_city_save, "texai", file, pcity, citystr);
205}
206
207/**********************************************************************/
210static void texwai_city_load(const struct section_file *file,
211 struct city *pcity, const char *citystr)
212{
213 TEXAI_AIT;
214 TEXAI_DFUNC(dai_city_load, "texai", file, pcity, citystr);
215}
216
217/**********************************************************************/
221 struct adv_choice *choice)
222{
223 TEXAI_AIT;
225}
226
227/**********************************************************************/
230static void texwai_wonder_city_distance(struct player *pplayer,
231 struct adv_data *adv)
232{
233 TEXAI_AIT;
235}
236
237/**********************************************************************/
240static void texwai_build_adv_init(struct player *pplayer)
241{
242 TEXAI_AIT;
244}
245
246/**********************************************************************/
249static void texwai_build_adv_adjust(struct player *pplayer,
250 struct city *wonder_city)
251{
252 TEXAI_AIT;
253 TEXAI_DFUNC(dai_build_adv_adjust, pplayer, wonder_city);
254}
255
256/**********************************************************************/
259static void texwai_gov_value(struct player *pplayer, struct government *gov,
260 adv_want *val, bool *override)
261{
262 TEXAI_AIT;
263 TEXAI_DFUNC(dai_gov_value, pplayer, gov, val, override);
264}
265
266/**********************************************************************/
274
275/**********************************************************************/
283
284/**********************************************************************/
287static void texwai_unit_alloc(struct unit *punit)
288{
289 TEXAI_AIT;
291}
292
293/**********************************************************************/
296static void texwai_unit_free(struct unit *punit)
297{
298 TEXAI_AIT;
300}
301
302/**********************************************************************/
305static void texwai_ferry_init_ferry(struct unit *ferry)
306{
307 TEXAI_AIT;
309}
310
311/**********************************************************************/
314static void texwai_ferry_transformed(struct unit *ferry,
315 const struct unit_type *old)
316{
317 TEXAI_AIT;
319}
320
321/**********************************************************************/
324static void texwai_ferry_lost(struct unit *punit)
325{
326 TEXAI_AIT;
328}
329
330/**********************************************************************/
333static void texwai_unit_turn_end(struct unit *punit)
334{
335 TEXAI_AIT;
337}
338
339/**********************************************************************/
343 struct tile *ptile,
344 struct pf_path *path, int step)
345{
346 TEXAI_AIT;
348}
349
350/**********************************************************************/
354 enum adv_unit_task task,
355 struct tile *ptile)
356{
357 TEXAI_AIT;
359}
360
361/**********************************************************************/
364static void texwai_unit_save(struct section_file *file,
365 const struct unit *punit, const char *unitstr)
366{
367 TEXAI_AIT;
368 TEXAI_DFUNC(dai_unit_save, "texai", file, punit, unitstr);
369}
370
371/**********************************************************************/
374static void texwai_unit_load(const struct section_file *file,
375 struct unit *punit, const char *unitstr)
376{
377 TEXAI_AIT;
378 TEXAI_DFUNC(dai_unit_load, "texai", file, punit, unitstr);
379}
380
381/**********************************************************************/
384static void texwai_auto_settler_reset(struct player *pplayer)
385{
386 TEXAI_AIT;
388}
389
390/**********************************************************************/
393static void texwai_auto_settler_run(struct player *pplayer,
394 struct unit *punit,
395 struct workermap *state)
396{
397 TEXAI_AIT;
398
399 /* TODO: Operate on tex map */
400 TEXAI_DFUNC(dai_auto_settler_run, &(wld.map), pplayer, punit, state);
401}
402
403/**********************************************************************/
406static void texwai_auto_settler_cont(struct player *pplayer,
407 struct unit *punit,
408 struct workermap *state)
409{
410 TEXAI_AIT;
411
412 /* TODO: Operate on tex map */
413 TEXAI_DFUNC(dai_auto_settler_cont, &(wld.map), pplayer, punit, state);
414}
415
416/**********************************************************************/
419static void texwai_switch_to_explore(struct unit *punit, struct tile *target,
420 enum override_bool *allow)
421{
422 TEXAI_AIT;
424}
425
426/**********************************************************************/
429static void texwai_first_activities(struct player *pplayer)
430{
431 TEXAI_AIT;
434}
435
436/**********************************************************************/
439static void texwai_restart_phase(struct player *pplayer)
440{
441 TEXAI_AIT;
443}
444
445/**********************************************************************/
448static void texwai_diplomacy_actions(struct player *pplayer)
449{
450 TEXAI_AIT;
452}
453
454/**********************************************************************/
457static void texwai_last_activities(struct player *pplayer)
458{
459 TEXAI_AIT;
461}
462
463/**********************************************************************/
466static void texwai_treaty_evaluate(struct player *pplayer,
467 struct player *aplayer,
468 struct treaty *ptreaty)
469{
470 TEXAI_AIT;
472}
473
474/**********************************************************************/
477static void texwai_treaty_accepted(struct player *pplayer,
478 struct player *aplayer,
479 struct treaty *ptreaty)
480{
481 TEXAI_AIT;
483}
484
485/**********************************************************************/
488static void texwai_diplomacy_first_contact(struct player *pplayer,
489 struct player *aplayer)
490{
491 TEXAI_AIT;
493}
494
495/**********************************************************************/
500 const struct action *paction,
501 struct player *receiver,
502 struct player *violator, struct player *victim)
503{
504 TEXAI_AIT;
506 receiver, violator, victim);
507}
508
509/**********************************************************************/
512static void texwai_city_log(char *buffer, int buflength,
513 const struct city *pcity)
514{
515 TEXAI_AIT;
517}
518
519/**********************************************************************/
522static void texwai_unit_log(char *buffer, int buflength,
523 const struct unit *punit)
524{
525 TEXAI_AIT;
527}
528
529/**********************************************************************/
532static void texwai_consider_plr_dangerous(struct player *plr1,
533 struct player *plr2,
534 enum override_bool *result)
535{
536 TEXAI_AIT;
537 TEXAI_DFUNC(dai_consider_plr_dangerous, plr1, plr2, result);
538}
539
540/**********************************************************************/
543static void texwai_consider_tile_dangerous(struct tile *ptile,
544 struct unit *punit,
545 enum override_bool *result)
546{
547 TEXAI_AIT;
549}
550
551/**********************************************************************/
554static void texwai_consider_wonder_city(struct city *pcity, bool *result)
555{
556 TEXAI_AIT;
558}
559
560/**********************************************************************/
563static void texwai_refresh(struct player *pplayer)
564{
565 TEXAI_AIT;
566 TEXAI_TFUNC(texai_refresh, pplayer);
567}
568
569/**********************************************************************/
572static void texwai_revolution_start(struct player *pplayer)
573{
574 TEXAI_AIT;
576}
577
578/**********************************************************************/
581const char *fc_ai_tex_capstr(void)
582{
583 return FC_AI_MOD_CAPSTR;
584}
585
586/**********************************************************************/
589bool fc_ai_tex_setup(struct ai_type *ai)
590{
591 struct dai_private_data *private;
592
593 if (!has_thread_cond_impl()) {
594 log_error(_("This Freeciv compilation has no full threads "
595 "implementation, tex ai cannot be used."));
596 return FALSE;
597 }
598
599 strncpy(ai->name, "tex", sizeof(ai->name));
600
601 private = fc_malloc(sizeof(struct dai_private_data));
602 private->contemplace_workers = FALSE; /* We use custom code to set worker want and type */
603 ai->private = private;
604
605 texai_init_self(ai);
606
608
612
621
624
635
637
640
643
646
650
655
658
662
664
669
674
677
681
683
687
689
690 return TRUE;
691}
#define FC_AI_MOD_CAPSTR
Definition ai.h:27
incident_type
Definition ai.h:45
void dai_ferry_lost(struct ai_type *ait, struct unit *punit)
Definition aiferry.c:221
void dai_ferry_transformed(struct ai_type *ait, struct unit *ferry, const struct unit_type *old)
Definition aiferry.c:189
void dai_ferry_init_ferry(struct ai_type *ait, struct unit *ferry)
Definition aiferry.c:167
void dai_do_last_activities(struct ai_type *ait, struct player *pplayer)
Definition aihand.c:774
void dai_do_first_activities(struct ai_type *ait, struct player *pplayer)
Definition aihand.c:748
char * incite_cost
Definition comments.c:76
void dai_city_save(struct ai_type *ait, const char *aitstr, struct section_file *file, const struct city *pcity, const char *citystr)
Definition daicity.c:1139
void dai_city_load(struct ai_type *ait, const char *aitstr, const struct section_file *file, struct city *pcity, const char *citystr)
Definition daicity.c:1166
void dai_consider_wonder_city(struct ai_type *ait, struct city *pcity, bool *result)
Definition daicity.c:2060
void dai_build_adv_adjust(struct ai_type *ait, struct player *pplayer, struct city *wonder_city)
Definition daicity.c:1949
void dai_build_adv_init(struct ai_type *ait, struct player *pplayer)
Definition daicity.c:1933
void dai_gov_value(struct ai_type *ait, struct player *pplayer, struct government *gov, adv_want *val, bool *override)
Definition daidata.c:524
void dai_data_phase_begin(struct ai_type *ait, struct player *pplayer, bool is_new_phase)
Definition daidata.c:142
void dai_data_phase_finished(struct ai_type *ait, struct player *pplayer)
Definition daidata.c:285
void dai_incident(struct ai_type *ait, enum incident_type type, enum casus_belli_range scope, const struct action *paction, struct player *receiver, struct player *violator, struct player *victim)
void dai_revolution_start(struct ai_type *ait, struct player *pplayer)
void dai_diplomacy_actions(struct ai_type *ait, struct player *pplayer)
void dai_treaty_accepted(struct ai_type *ait, struct player *pplayer, struct player *aplayer, struct treaty *ptreaty)
void dai_treaty_evaluate(struct ai_type *ait, struct player *pplayer, struct player *aplayer, struct treaty *ptreaty)
void dai_diplomacy_first_contact(struct ai_type *ait, struct player *pplayer, struct player *aplayer)
void dai_wonder_city_distance(struct ai_type *ait, struct player *pplayer, struct adv_data *adv)
void dai_unit_log(struct ai_type *ait, char *buffer, int buflength, const struct unit *punit)
Definition dailog.c:54
void dai_city_log(struct ai_type *ait, char *buffer, int buflength, const struct city *pcity)
Definition dailog.c:41
void dai_assess_danger_player(struct ai_type *ait, const struct civ_map *nmap, struct player *pplayer)
void dai_player_save(struct ai_type *ait, const char *aitstr, struct player *pplayer, struct section_file *file, int plrno)
Definition daiplayer.c:65
void dai_player_copy(struct ai_type *ait, struct player *original, struct player *created)
Definition daiplayer.c:151
void dai_player_load(struct ai_type *ait, const char *aitstr, struct player *pplayer, const struct section_file *file, int plrno)
Definition daiplayer.c:108
void dai_gained_control(struct ai_type *ait, struct player *pplayer)
Definition daiplayer.c:174
void dai_auto_settler_run(struct ai_type *ait, const struct civ_map *nmap, struct player *pplayer, struct unit *punit, struct workermap *state)
void dai_auto_settler_cont(struct ai_type *ait, const struct civ_map *nmap, struct player *pplayer, struct unit *punit, struct workermap *state)
void dai_auto_settler_reset(struct ai_type *ait, struct player *pplayer)
void dai_build_adv_override(struct ai_type *ait, struct city *pcity, struct adv_choice *choice)
Definition daitools.c:1368
void dai_consider_plr_dangerous(struct ai_type *ait, struct player *plr1, struct player *plr2, enum override_bool *result)
Definition daitools.c:141
void dai_unit_new_adv_task(struct ai_type *ait, struct unit *punit, enum adv_unit_task task, struct tile *ptile)
Definition daitools.c:619
void dai_unit_move_or_attack(struct ai_type *ait, struct unit *punit, struct tile *ptile, struct pf_path *path, int step)
Definition daitools.c:1066
void dai_unit_save(struct ai_type *ait, const char *aitstr, struct section_file *file, const struct unit *punit, const char *unitstr)
Definition daiunit.c:3369
void dai_units_ruleset_init(struct ai_type *ait)
Definition daiunit.c:3208
void dai_switch_to_explore(struct ai_type *ait, struct unit *punit, struct tile *target, enum override_bool *allow)
Definition daiunit.c:3483
void dai_unit_turn_end(struct ai_type *ait, struct unit *punit)
Definition daiunit.c:3339
void dai_unit_init(struct ai_type *ait, struct unit *punit)
Definition daiunit.c:3317
void dai_consider_tile_dangerous(struct ai_type *ait, struct tile *ptile, struct unit *punit, enum override_bool *result)
Definition daiunit.c:3127
void dai_unit_load(struct ai_type *ait, const char *aitstr, const struct section_file *file, struct unit *punit, const char *unitstr)
Definition daiunit.c:3388
void dai_unit_close(struct ai_type *ait, struct unit *punit)
Definition daiunit.c:3351
void dai_units_ruleset_close(struct ai_type *ait)
Definition daiunit.c:3299
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
Definition dialogs_g.h:74
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
Definition dialogs_g.h:78
struct treaty * ptreaty
Definition diplodlg_g.h:28
float adv_want
Definition fc_types.h:1063
adv_unit_task
Definition fc_types.h:229
override_bool
Definition fc_types.h:94
#define _(String)
Definition fcintl.h:67
bool has_thread_cond_impl(void)
Definition fcthread.c:405
struct world wld
Definition game.c:62
GType type
Definition repodlgs.c:1313
#define log_error(message,...)
Definition log.h:104
#define FC_FREE(ptr)
Definition mem.h:41
#define fc_malloc(sz)
Definition mem.h:34
int step
Definition specpq.h:92
Definition ai.h:50
void(* revolution_start)(struct player *pplayer)
Definition ai.h:320
void(* log_fragment_unit)(char *buffer, int buflength, const struct unit *punit)
Definition ai.h:287
void(* city_alloc)(struct city *pcity)
Definition ai.h:128
void(* created_by_civil_war)(struct player *original, struct player *created)
Definition ai.h:117
void(* consider_tile_dangerous)(struct tile *ptile, struct unit *punit, enum override_bool *result)
Definition ai.h:294
void(* unit_lost)(struct unit *punit)
Definition ai.h:205
void(* gov_value)(struct player *pplayer, struct government *gov, adv_want *val, bool *override)
Definition ai.h:173
void(* unit_transformed)(struct unit *punit, const struct unit_type *old_type)
Definition ai.h:202
void(* log_fragment_city)(char *buffer, int buflength, const struct city *pcity)
Definition ai.h:283
void(* settler_run)(struct player *pplayer, struct unit *punit, struct workermap *state)
Definition ai.h:233
void(* unit_load)(const struct section_file *file, struct unit *punit, const char *unitstr)
Definition ai.h:226
void(* unit_move)(struct unit *punit, struct tile *ptile, struct pf_path *path, int step)
Definition ai.h:211
void(* unit_free)(struct unit *punit)
Definition ai.h:188
void(* map_alloc)(void)
Definition ai.h:67
void(* phase_finished)(struct player *pplayer)
Definition ai.h:124
void(* tile_info)(struct tile *ptile)
Definition ai.h:305
void(* restart_phase)(struct player *pplayer)
Definition ai.h:250
void(* settler_reset)(struct player *pplayer)
Definition ai.h:230
void(* unit_save)(struct section_file *file, const struct unit *punit, const char *unitstr)
Definition ai.h:222
void(* refresh)(struct player *pplayer)
Definition ai.h:302
void(* treaty_evaluate)(struct player *pplayer, struct player *aplayer, struct treaty *ptreaty)
Definition ai.h:260
void(* unit_created)(struct unit *punit)
Definition ai.h:192
void(* units_ruleset_close)(void)
Definition ai.h:180
void(* unit_info)(struct unit *punit)
Definition ai.h:317
void(* city_destroyed)(struct city *pcity)
Definition ai.h:140
void(* diplomacy_actions)(struct player *pplayer)
Definition ai.h:254
void(* player_alloc)(struct player *pplayer)
Definition ai.h:77
void(* build_adv_prepare)(struct player *pplayer, struct adv_data *adv)
Definition ai.h:161
void(* build_adv_adjust_want)(struct player *pplayer, struct city *wonder_city)
Definition ai.h:170
void(* city_info)(struct city *pcity)
Definition ai.h:311
void(* player_load)(struct player *pplayer, const struct section_file *file, int plrno)
Definition ai.h:87
void(* build_adv_init)(struct player *pplayer)
Definition ai.h:165
void(* unit_task)(struct unit *punit, enum adv_unit_task task, struct tile *ptile)
Definition ai.h:218
void(* last_activities)(struct player *pplayer)
Definition ai.h:257
void(* incident)(enum incident_type type, enum casus_belli_range scope, const struct action *paction, struct player *receiver, struct player *violator, struct player *victim)
Definition ai.h:276
void(* first_contact)(struct player *pplayer, struct player *aplayer)
Definition ai.h:272
void(* map_free)(void)
Definition ai.h:74
void(* city_created)(struct city *pcity)
Definition ai.h:136
void(* city_save)(struct section_file *file, const struct city *pcity, const char *citystr)
Definition ai.h:149
void(* consider_wonder_city)(struct city *pcity, bool *result)
Definition ai.h:299
struct ai_type::@15 funcs
void(* city_free)(struct city *pcity)
Definition ai.h:132
void(* choose_building)(struct city *pcity, struct adv_choice *choice)
Definition ai.h:158
void(* module_close)(void)
Definition ai.h:57
void(* city_load)(const struct section_file *file, struct city *pcity, const char *citystr)
Definition ai.h:153
void(* unit_destroyed)(struct unit *punit)
Definition ai.h:196
void(* phase_begin)(struct player *pplayer, bool new_phase)
Definition ai.h:121
void(* player_free)(struct player *pplayer)
Definition ai.h:80
void(* split_by_civil_war)(struct player *original, struct player *created)
Definition ai.h:114
void(* unit_turn_end)(struct unit *punit)
Definition ai.h:208
void(* unit_alloc)(struct unit *punit)
Definition ai.h:184
void(* gained_control)(struct player *pplayer)
Definition ai.h:108
char name[MAX_LEN_NAME]
Definition ai.h:51
void(* map_ready)(void)
Definition ai.h:71
void(* unit_got)(struct unit *punit)
Definition ai.h:199
void * private
Definition ai.h:53
void(* player_save)(struct player *pplayer, struct section_file *file, int plrno)
Definition ai.h:83
void(* first_activities)(struct player *pplayer)
Definition ai.h:247
void(* consider_plr_dangerous)(struct player *plr1, struct player *plr2, enum override_bool *result)
Definition ai.h:290
void(* lost_control)(struct player *pplayer)
Definition ai.h:111
void(* treaty_accepted)(struct player *pplayer, struct player *aplayer, struct treaty *ptreaty)
Definition ai.h:265
void(* units_ruleset_init)(void)
Definition ai.h:177
void(* settler_cont)(struct player *pplayer, struct unit *punit, struct workermap *state)
Definition ai.h:238
void(* unit_move_seen)(struct unit *punit)
Definition ai.h:215
void(* want_to_explore)(struct unit *punit, struct tile *target, enum override_bool *allow)
Definition ai.h:242
Definition city.h:317
Definition tile.h:50
Definition unit.h:140
struct civ_map map
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47
static void texwai_created_by_civil_war(struct player *original, struct player *created)
Definition texai.c:153
static void texwai_unit_load(const struct section_file *file, struct unit *punit, const char *unitstr)
Definition texai.c:374
static void texwai_player_alloc(struct player *pplayer)
Definition texai.c:83
const char * fc_ai_tex_capstr(void)
Definition texai.c:581
static void texwai_diplomacy_first_contact(struct player *pplayer, struct player *aplayer)
Definition texai.c:488
bool fc_ai_tex_setup(struct ai_type *ai)
Definition texai.c:589
static void texwai_ferry_transformed(struct unit *ferry, const struct unit_type *old)
Definition texai.c:314
static void texwai_city_alloc(struct city *pcity)
Definition texai.c:182
static void texwai_unit_new_adv_task(struct unit *punit, enum adv_unit_task task, struct tile *ptile)
Definition texai.c:353
static void texwai_restart_phase(struct player *pplayer)
Definition texai.c:439
static void texwai_treaty_evaluate(struct player *pplayer, struct player *aplayer, struct treaty *ptreaty)
Definition texai.c:466
static void texwai_auto_settler_reset(struct player *pplayer)
Definition texai.c:384
static void texwai_consider_plr_dangerous(struct player *plr1, struct player *plr2, enum override_bool *result)
Definition texai.c:532
static void texwai_build_adv_init(struct player *pplayer)
Definition texai.c:240
static void texwai_first_activities(struct player *pplayer)
Definition texai.c:429
static void texwai_phase_finished(struct player *pplayer)
Definition texai.c:172
#define TEXAI_TFUNC(_func,...)
Definition texai.c:67
static void texwai_phase_begin(struct player *pplayer, bool is_new_phase)
Definition texai.c:163
static void texwai_gov_value(struct player *pplayer, struct government *gov, adv_want *val, bool *override)
Definition texai.c:259
static void texwai_wonder_city_distance(struct player *pplayer, struct adv_data *adv)
Definition texai.c:230
static void texwai_auto_settler_run(struct player *pplayer, struct unit *punit, struct workermap *state)
Definition texai.c:393
static void texwai_unit_log(char *buffer, int buflength, const struct unit *punit)
Definition texai.c:522
static void texwai_city_log(char *buffer, int buflength, const struct city *pcity)
Definition texai.c:512
static void texwai_city_free(struct city *pcity)
Definition texai.c:191
#define TEXAI_DFUNC(_func,...)
Definition texai.c:68
static void texwai_build_adv_override(struct city *pcity, struct adv_choice *choice)
Definition texai.c:220
static void texwai_switch_to_explore(struct unit *punit, struct tile *target, enum override_bool *allow)
Definition texai.c:419
static void texwai_last_activities(struct player *pplayer)
Definition texai.c:457
static void texwai_ferry_init_ferry(struct unit *ferry)
Definition texai.c:305
static void texwai_unit_turn_end(struct unit *punit)
Definition texai.c:333
static void texwai_consider_tile_dangerous(struct tile *ptile, struct unit *punit, enum override_bool *result)
Definition texai.c:543
static void texwai_city_save(struct section_file *file, const struct city *pcity, const char *citystr)
Definition texai.c:200
static void texwai_unit_alloc(struct unit *punit)
Definition texai.c:287
static void texwai_unit_free(struct unit *punit)
Definition texai.c:296
static void texai_init_self(struct ai_type *ai)
Definition texai.c:51
static void texwai_split_by_civil_war(struct player *original, struct player *created)
Definition texai.c:143
struct ai_type * texai_get_self(void)
Definition texai.c:61
static void texwai_player_load(struct player *pplayer, const struct section_file *file, int plrno)
Definition texai.c:113
static void texwai_city_load(const struct section_file *file, struct city *pcity, const char *citystr)
Definition texai.c:210
static void texwai_auto_settler_cont(struct player *pplayer, struct unit *punit, struct workermap *state)
Definition texai.c:406
#define TEXAI_AIT
Definition texai.c:66
static void texwai_units_ruleset_close(void)
Definition texai.c:278
static struct ai_type * self
Definition texai.c:46
static void texwai_player_free(struct player *pplayer)
Definition texai.c:93
static void texwai_unit_move_or_attack(struct unit *punit, struct tile *ptile, struct pf_path *path, int step)
Definition texai.c:342
static void texwai_build_adv_adjust(struct player *pplayer, struct city *wonder_city)
Definition texai.c:249
static void texwai_consider_wonder_city(struct city *pcity, bool *result)
Definition texai.c:554
static void texwai_units_ruleset_init(void)
Definition texai.c:269
static void texwai_control_gained(struct player *pplayer)
Definition texai.c:124
static void texwai_treaty_accepted(struct player *pplayer, struct player *aplayer, struct treaty *ptreaty)
Definition texai.c:477
static void texwai_unit_save(struct section_file *file, const struct unit *punit, const char *unitstr)
Definition texai.c:364
static void texwai_player_save(struct player *pplayer, struct section_file *file, int plrno)
Definition texai.c:103
static void texai_module_close(void)
Definition texai.c:73
static void texwai_ferry_lost(struct unit *punit)
Definition texai.c:324
static void texwai_control_lost(struct player *pplayer)
Definition texai.c:134
static void texwai_incident(enum incident_type type, enum casus_belli_range scope, const struct action *paction, struct player *receiver, struct player *violator, struct player *victim)
Definition texai.c:498
static void texwai_refresh(struct player *pplayer)
Definition texai.c:563
static void texwai_revolution_start(struct player *pplayer)
Definition texai.c:572
static void texwai_diplomacy_actions(struct player *pplayer)
Definition texai.c:448
void texai_city_alloc(struct ai_type *ait, struct city *pcity)
Definition texaicity.c:567
void texai_city_free(struct ai_type *ait, struct city *pcity)
Definition texaicity.c:580
void texai_first_activities(struct ai_type *ait, struct player *pplayer)
Definition texaimsg.c:63
void texai_phase_finished(struct ai_type *ait, struct player *pplayer)
Definition texaimsg.c:71
void texai_player_alloc(struct ai_type *ait, struct player *pplayer)
void texai_control_gained(struct ai_type *ait, struct player *pplayer)
void texai_player_free(struct ai_type *ait, struct player *pplayer)
void texai_control_lost(struct ai_type *ait, struct player *pplayer)
void texai_refresh(struct ai_type *ait, struct player *pplayer)
void texai_init_threading(void)
Definition texaiplayer.c:73
void texai_map_alloc(void)
void texai_whole_map_copy(void)
void texai_map_free(void)
void texai_city_created(struct city *pcity)
Definition texaiworld.c:162
void texai_city_destroyed(struct city *pcity)
Definition texaiworld.c:227
void texai_unit_destroyed(struct unit *punit)
Definition texaiworld.c:339
void texai_unit_changed(struct unit *punit)
Definition texaiworld.c:292
void texai_tile_info(struct tile *ptile)
Definition texaiworld.c:111
void texai_city_changed(struct city *pcity)
Definition texaiworld.c:170
void texai_unit_move_seen(struct unit *punit)
Definition texaiworld.c:377
void texai_unit_created(struct unit *punit)
Definition texaiworld.c:284