Freeciv-3.2
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 "aitools.h"
26#include "daicity.h"
27#include "daidiplomacy.h"
28#include "daidomestic.h"
29#include "dailog.h"
30#include "daimilitary.h"
31#include "daiplayer.h"
32#include "daisettler.h"
33
34/* tex ai */
35#include "texaicity.h"
36#include "texaimsg.h"
37#include "texaiplayer.h"
38#include "texaiworld.h"
39
40const char *fc_ai_tex_capstr(void);
41bool fc_ai_tex_setup(struct ai_type *ai);
42
43static void texai_init_self(struct ai_type *ai);
44
45static struct ai_type *self = NULL;
46
47/**********************************************************************/
50static void texai_init_self(struct ai_type *ai)
51{
52 self = ai;
53
55}
56
57/**********************************************************************/
61{
62 return self;
63}
64
65#define TEXAI_AIT struct ai_type *ait = texai_get_self();
66#define TEXAI_TFUNC(_func, ...) _func(ait, ## __VA_ARGS__ );
67#define TEXAI_DFUNC(_func, ...) _func(ait, ## __VA_ARGS__ );
68
69/**********************************************************************/
72static void texai_module_close(void)
73{
75
76 FC_FREE(ait->private);
77}
78
79/**********************************************************************/
82static void texwai_player_alloc(struct player *pplayer)
83{
86 /* Do not call default AI here, texai_player_alloc() does necessary parts */
87}
88
89/**********************************************************************/
92static void texwai_player_free(struct player *pplayer)
93{
96 /* Do not call default AI here, texai_player_free() does necessary parts */
97}
98
99/**********************************************************************/
102static void texwai_player_save(struct player *pplayer,
103 struct section_file *file, int plrno)
104{
105 TEXAI_AIT;
106 TEXAI_DFUNC(dai_player_save, "texai", pplayer, file, plrno);
107}
108
109/**********************************************************************/
112static void texwai_player_load(struct player *pplayer,
113 const struct section_file *file,
114 int plrno)
115{
116 TEXAI_AIT;
117 TEXAI_DFUNC(dai_player_load, "texai", pplayer, file, plrno);
118}
119
120/**********************************************************************/
123static void texwai_control_gained(struct player *pplayer)
124{
125 TEXAI_AIT;
128}
129
130/**********************************************************************/
133static void texwai_control_lost(struct player *pplayer)
134{
135 TEXAI_AIT;
137}
138
139/**********************************************************************/
142static void texwai_split_by_civil_war(struct player *original,
143 struct player *created)
144{
145 TEXAI_AIT;
147}
148
149/**********************************************************************/
152static void texwai_created_by_civil_war(struct player *original,
153 struct player *created)
154{
155 TEXAI_AIT;
157}
158
159/**********************************************************************/
162static void texwai_phase_begin(struct player *pplayer, bool is_new_phase)
163{
164 TEXAI_AIT;
166}
167
168/**********************************************************************/
171static void texwai_phase_finished(struct player *pplayer)
172{
173 TEXAI_AIT;
176}
177
178/**********************************************************************/
181static void texwai_city_alloc(struct city *pcity)
182{
183 TEXAI_AIT;
185}
186
187/**********************************************************************/
190static void texwai_city_free(struct city *pcity)
191{
192 TEXAI_AIT;
194}
195
196/**********************************************************************/
199static void texwai_city_save(struct section_file *file,
200 const struct city *pcity, const char *citystr)
201{
202 TEXAI_AIT;
203 TEXAI_DFUNC(dai_city_save, "texai", file, pcity, citystr);
204}
205
206/**********************************************************************/
209static void texwai_city_load(const struct section_file *file,
210 struct city *pcity, const char *citystr)
211{
212 TEXAI_AIT;
213 TEXAI_DFUNC(dai_city_load, "texai", file, pcity, citystr);
214}
215
216/**********************************************************************/
219static void texwai_build_adv_override(struct city *pcity,
220 struct adv_choice *choice)
221{
222 TEXAI_AIT;
223 TEXAI_DFUNC(dai_build_adv_override, pcity, choice);
224}
225
226/**********************************************************************/
229static void texwai_wonder_city_distance(struct player *pplayer,
230 struct adv_data *adv)
231{
232 TEXAI_AIT;
234}
235
236/**********************************************************************/
239static void texwai_build_adv_init(struct player *pplayer)
240{
241 TEXAI_AIT;
243}
244
245/**********************************************************************/
248static void texwai_build_adv_adjust(struct player *pplayer,
249 struct city *wonder_city)
250{
251 TEXAI_AIT;
252 TEXAI_DFUNC(dai_build_adv_adjust, pplayer, wonder_city);
253}
254
255/**********************************************************************/
258static void texwai_gov_value(struct player *pplayer, struct government *gov,
259 adv_want *val, bool *override)
260{
261 TEXAI_AIT;
262 TEXAI_DFUNC(dai_gov_value, pplayer, gov, val, override);
263}
264
265/**********************************************************************/
273
274/**********************************************************************/
282
283/**********************************************************************/
286static void texwai_unit_alloc(struct unit *punit)
287{
288 TEXAI_AIT;
290}
291
292/**********************************************************************/
295static void texwai_unit_free(struct unit *punit)
296{
297 TEXAI_AIT;
299}
300
301/**********************************************************************/
304static void texwai_ferry_init_ferry(struct unit *ferry)
305{
306 TEXAI_AIT;
308}
309
310/**********************************************************************/
313static void texwai_ferry_transformed(struct unit *ferry,
314 const struct unit_type *old)
315{
316 TEXAI_AIT;
318}
319
320/**********************************************************************/
323static void texwai_ferry_lost(struct unit *punit)
324{
325 TEXAI_AIT;
327}
328
329/**********************************************************************/
332static void texwai_unit_turn_end(struct unit *punit)
333{
334 TEXAI_AIT;
336}
337
338/**********************************************************************/
342 struct tile *ptile,
343 struct pf_path *path, int step)
344{
345 TEXAI_AIT;
347}
348
349/**********************************************************************/
353 enum adv_unit_task task,
354 struct tile *ptile)
355{
356 TEXAI_AIT;
358}
359
360/**********************************************************************/
363static void texwai_unit_save(struct section_file *file,
364 const struct unit *punit, const char *unitstr)
365{
366 TEXAI_AIT;
367 TEXAI_DFUNC(dai_unit_save, "texai", file, punit, unitstr);
368}
369
370/**********************************************************************/
373static void texwai_unit_load(const struct section_file *file,
374 struct unit *punit, const char *unitstr)
375{
376 TEXAI_AIT;
377 TEXAI_DFUNC(dai_unit_load, "texai", file, punit, unitstr);
378}
379
380/**********************************************************************/
383static void texwai_auto_settler_reset(struct player *pplayer)
384{
385 TEXAI_AIT;
387}
388
389/**********************************************************************/
392static void texwai_auto_settler_run(struct player *pplayer,
393 struct unit *punit,
394 struct settlermap *state)
395{
396 TEXAI_AIT;
397
398 /* TODO: Operate on tex map */
399 TEXAI_DFUNC(dai_auto_settler_run, &(wld.map), pplayer, punit, state);
400}
401
402/**********************************************************************/
405static void texwai_auto_settler_cont(struct player *pplayer,
406 struct unit *punit,
407 struct settlermap *state)
408{
409 TEXAI_AIT;
410
411 /* TODO: Operate on tex map */
412 TEXAI_DFUNC(dai_auto_settler_cont, &(wld.map), pplayer, punit, state);
413}
414
415/**********************************************************************/
418static void texwai_switch_to_explore(struct unit *punit, struct tile *target,
419 enum override_bool *allow)
420{
421 TEXAI_AIT;
423}
424
425/**********************************************************************/
428static void texwai_first_activities(struct player *pplayer)
429{
430 TEXAI_AIT;
433}
434
435/**********************************************************************/
438static void texwai_restart_phase(struct player *pplayer)
439{
440 TEXAI_AIT;
442}
443
444/**********************************************************************/
447static void texwai_diplomacy_actions(struct player *pplayer)
448{
449 TEXAI_AIT;
451}
452
453/**********************************************************************/
456static void texwai_last_activities(struct player *pplayer)
457{
458 TEXAI_AIT;
460}
461
462/**********************************************************************/
465static void texwai_treaty_evaluate(struct player *pplayer,
466 struct player *aplayer,
467 struct Treaty *ptreaty)
468{
469 TEXAI_AIT;
471}
472
473/**********************************************************************/
476static void texwai_treaty_accepted(struct player *pplayer,
477 struct player *aplayer,
478 struct Treaty *ptreaty)
479{
480 TEXAI_AIT;
482}
483
484/**********************************************************************/
487static void texwai_diplomacy_first_contact(struct player *pplayer,
488 struct player *aplayer)
489{
490 TEXAI_AIT;
492}
493
494/**********************************************************************/
499 const struct action *paction,
500 struct player *receiver,
501 struct player *violator, struct player *victim)
502{
503 TEXAI_AIT;
505 receiver, violator, victim);
506}
507
508/**********************************************************************/
511static void texwai_city_log(char *buffer, int buflength,
512 const struct city *pcity)
513{
514 TEXAI_AIT;
515 TEXAI_DFUNC(dai_city_log, buffer, buflength, pcity);
516}
517
518/**********************************************************************/
521static void texwai_unit_log(char *buffer, int buflength,
522 const struct unit *punit)
523{
524 TEXAI_AIT;
526}
527
528/**********************************************************************/
531static void texwai_consider_plr_dangerous(struct player *plr1,
532 struct player *plr2,
533 enum override_bool *result)
534{
535 TEXAI_AIT;
536 TEXAI_DFUNC(dai_consider_plr_dangerous, plr1, plr2, result);
537}
538
539/**********************************************************************/
542static void texwai_consider_tile_dangerous(struct tile *ptile,
543 struct unit *punit,
544 enum override_bool *result)
545{
546 TEXAI_AIT;
548}
549
550/**********************************************************************/
553static void texwai_consider_wonder_city(struct city *pcity, bool *result)
554{
555 TEXAI_AIT;
557}
558
559/**********************************************************************/
562static void texwai_refresh(struct player *pplayer)
563{
564 TEXAI_AIT;
565 TEXAI_TFUNC(texai_refresh, pplayer);
566}
567
568/**********************************************************************/
571static void texwai_revolution_start(struct player *pplayer)
572{
573 TEXAI_AIT;
575}
576
577/**********************************************************************/
580const char *fc_ai_tex_capstr(void)
581{
582 return FC_AI_MOD_CAPSTR;
583}
584
585/**********************************************************************/
588bool fc_ai_tex_setup(struct ai_type *ai)
589{
590 struct dai_private_data *private;
591
592 if (!has_thread_cond_impl()) {
593 log_error(_("This Freeciv compilation has no full threads "
594 "implementation, tex ai cannot be used."));
595 return FALSE;
596 }
597
598 strncpy(ai->name, "tex", sizeof(ai->name));
599
600 private = fc_malloc(sizeof(struct dai_private_data));
601 private->contemplace_workers = FALSE; /* We use custom code to set worker want and type */
602 ai->private = private;
603
604 texai_init_self(ai);
605
607
611
620
623
634
636
639
642
645
649
654
657
661
663
668
673
676
680
682
686
688
689 return TRUE;
690}
#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
void dai_build_adv_override(struct ai_type *ait, struct city *pcity, struct adv_choice *choice)
Definition aitools.c:1369
void dai_consider_plr_dangerous(struct ai_type *ait, struct player *plr1, struct player *plr2, enum override_bool *result)
Definition aitools.c:142
void dai_unit_new_adv_task(struct ai_type *ait, struct unit *punit, enum adv_unit_task task, struct tile *ptile)
Definition aitools.c:620
void dai_unit_move_or_attack(struct ai_type *ait, struct unit *punit, struct tile *ptile, struct pf_path *path, int step)
Definition aitools.c:1067
char * incite_cost
Definition comments.c:75
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:1138
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:1165
void dai_consider_wonder_city(struct ai_type *ait, struct city *pcity, bool *result)
Definition daicity.c:2056
void dai_build_adv_adjust(struct ai_type *ait, struct player *pplayer, struct city *wonder_city)
Definition daicity.c:1945
void dai_build_adv_init(struct ai_type *ait, struct player *pplayer)
Definition daicity.c:1929
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_treaty_accepted(struct ai_type *ait, struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty)
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_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_cont(struct ai_type *ait, const struct civ_map *nmap, struct player *pplayer, struct unit *punit, struct settlermap *state)
void dai_auto_settler_reset(struct ai_type *ait, struct player *pplayer)
void dai_auto_settler_run(struct ai_type *ait, const struct civ_map *nmap, struct player *pplayer, struct unit *punit, struct settlermap *state)
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:3362
void dai_units_ruleset_init(struct ai_type *ait)
Definition daiunit.c:3201
void dai_switch_to_explore(struct ai_type *ait, struct unit *punit, struct tile *target, enum override_bool *allow)
Definition daiunit.c:3476
void dai_unit_turn_end(struct ai_type *ait, struct unit *punit)
Definition daiunit.c:3332
void dai_unit_init(struct ai_type *ait, struct unit *punit)
Definition daiunit.c:3310
void dai_consider_tile_dangerous(struct ai_type *ait, struct tile *ptile, struct unit *punit, enum override_bool *result)
Definition daiunit.c:3121
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:3381
void dai_unit_close(struct ai_type *ait, struct unit *punit)
Definition daiunit.c:3344
void dai_units_ruleset_close(struct ai_type *ait)
Definition daiunit.c:3292
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 Treaty * ptreaty
Definition diplodlg_g.h:28
float adv_want
Definition fc_types.h:1354
adv_unit_task
Definition fc_types.h:370
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:63
GType type
Definition repodlgs.c:1313
#define log_error(message,...)
Definition log.h:103
#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(* treaty_evaluate)(struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty)
Definition ai.h:260
void(* gov_value)(struct player *pplayer, struct government *gov, adv_want *val, bool *override)
Definition ai.h:173
void(* treaty_accepted)(struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty)
Definition ai.h:265
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 settlermap *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(* 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(* settler_cont)(struct player *pplayer, struct unit *punit, struct settlermap *state)
Definition ai.h:238
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
void(* city_free)(struct city *pcity)
Definition ai.h:132
void(* choose_building)(struct city *pcity, struct adv_choice *choice)
Definition ai.h:158
struct ai_type::@14 funcs
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(* units_ruleset_init)(void)
Definition ai.h:177
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:320
Definition tile.h:50
Definition unit.h:138
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:152
static void texwai_unit_load(const struct section_file *file, struct unit *punit, const char *unitstr)
Definition texai.c:373
static void texwai_player_alloc(struct player *pplayer)
Definition texai.c:82
const char * fc_ai_tex_capstr(void)
Definition texai.c:580
static void texwai_diplomacy_first_contact(struct player *pplayer, struct player *aplayer)
Definition texai.c:487
bool fc_ai_tex_setup(struct ai_type *ai)
Definition texai.c:588
static void texwai_ferry_transformed(struct unit *ferry, const struct unit_type *old)
Definition texai.c:313
static void texwai_city_alloc(struct city *pcity)
Definition texai.c:181
static void texwai_unit_new_adv_task(struct unit *punit, enum adv_unit_task task, struct tile *ptile)
Definition texai.c:352
static void texwai_restart_phase(struct player *pplayer)
Definition texai.c:438
static void texwai_treaty_evaluate(struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty)
Definition texai.c:465
static void texwai_auto_settler_reset(struct player *pplayer)
Definition texai.c:383
static void texwai_consider_plr_dangerous(struct player *plr1, struct player *plr2, enum override_bool *result)
Definition texai.c:531
static void texwai_build_adv_init(struct player *pplayer)
Definition texai.c:239
static void texwai_first_activities(struct player *pplayer)
Definition texai.c:428
static void texwai_phase_finished(struct player *pplayer)
Definition texai.c:171
#define TEXAI_TFUNC(_func,...)
Definition texai.c:66
static void texwai_phase_begin(struct player *pplayer, bool is_new_phase)
Definition texai.c:162
static void texwai_gov_value(struct player *pplayer, struct government *gov, adv_want *val, bool *override)
Definition texai.c:258
static void texwai_wonder_city_distance(struct player *pplayer, struct adv_data *adv)
Definition texai.c:229
static void texwai_unit_log(char *buffer, int buflength, const struct unit *punit)
Definition texai.c:521
static void texwai_city_log(char *buffer, int buflength, const struct city *pcity)
Definition texai.c:511
static void texwai_auto_settler_cont(struct player *pplayer, struct unit *punit, struct settlermap *state)
Definition texai.c:405
static void texwai_city_free(struct city *pcity)
Definition texai.c:190
#define TEXAI_DFUNC(_func,...)
Definition texai.c:67
static void texwai_build_adv_override(struct city *pcity, struct adv_choice *choice)
Definition texai.c:219
static void texwai_switch_to_explore(struct unit *punit, struct tile *target, enum override_bool *allow)
Definition texai.c:418
static void texwai_last_activities(struct player *pplayer)
Definition texai.c:456
static void texwai_ferry_init_ferry(struct unit *ferry)
Definition texai.c:304
static void texwai_unit_turn_end(struct unit *punit)
Definition texai.c:332
static void texwai_consider_tile_dangerous(struct tile *ptile, struct unit *punit, enum override_bool *result)
Definition texai.c:542
static void texwai_city_save(struct section_file *file, const struct city *pcity, const char *citystr)
Definition texai.c:199
static void texwai_unit_alloc(struct unit *punit)
Definition texai.c:286
static void texwai_unit_free(struct unit *punit)
Definition texai.c:295
static void texai_init_self(struct ai_type *ai)
Definition texai.c:50
static void texwai_split_by_civil_war(struct player *original, struct player *created)
Definition texai.c:142
struct ai_type * texai_get_self(void)
Definition texai.c:60
static void texwai_player_load(struct player *pplayer, const struct section_file *file, int plrno)
Definition texai.c:112
static void texwai_city_load(const struct section_file *file, struct city *pcity, const char *citystr)
Definition texai.c:209
#define TEXAI_AIT
Definition texai.c:65
static void texwai_units_ruleset_close(void)
Definition texai.c:277
static struct ai_type * self
Definition texai.c:45
static void texwai_player_free(struct player *pplayer)
Definition texai.c:92
static void texwai_unit_move_or_attack(struct unit *punit, struct tile *ptile, struct pf_path *path, int step)
Definition texai.c:341
static void texwai_build_adv_adjust(struct player *pplayer, struct city *wonder_city)
Definition texai.c:248
static void texwai_consider_wonder_city(struct city *pcity, bool *result)
Definition texai.c:553
static void texwai_units_ruleset_init(void)
Definition texai.c:268
static void texwai_control_gained(struct player *pplayer)
Definition texai.c:123
static void texwai_unit_save(struct section_file *file, const struct unit *punit, const char *unitstr)
Definition texai.c:363
static void texwai_player_save(struct player *pplayer, struct section_file *file, int plrno)
Definition texai.c:102
static void texai_module_close(void)
Definition texai.c:72
static void texwai_ferry_lost(struct unit *punit)
Definition texai.c:323
static void texwai_control_lost(struct player *pplayer)
Definition texai.c:133
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:497
static void texwai_treaty_accepted(struct player *pplayer, struct player *aplayer, struct Treaty *ptreaty)
Definition texai.c:476
static void texwai_refresh(struct player *pplayer)
Definition texai.c:562
static void texwai_auto_settler_run(struct player *pplayer, struct unit *punit, struct settlermap *state)
Definition texai.c:392
static void texwai_revolution_start(struct player *pplayer)
Definition texai.c:571
static void texwai_diplomacy_actions(struct player *pplayer)
Definition texai.c:447
void texai_city_alloc(struct ai_type *ait, struct city *pcity)
Definition texaicity.c:565
void texai_city_free(struct ai_type *ait, struct city *pcity)
Definition texaicity.c:578
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