Freeciv-3.4
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 "daicity.h"
24#include "daidiplomacy.h"
25#include "daidomestic.h"
26#include "daiferry.h"
27#include "daihand.h"
28#include "dailog.h"
29#include "daimilitary.h"
30#include "daiplayer.h"
31#include "daisanity.h"
32#include "daisettler.h"
33#include "daitools.h"
34#include "daiunit.h"
35
36/* tex ai */
37#include "texaicity.h"
38#include "texaimsg.h"
39#include "texaiplayer.h"
40#include "texaiworld.h"
41
42const char *fc_ai_tex_capstr(void);
43bool fc_ai_tex_setup(struct ai_type *ai);
44
45static void texai_init_self(struct ai_type *ai);
46
47static struct ai_type *self = NULL;
48
49/**********************************************************************/
52static void texai_init_self(struct ai_type *ai)
53{
54 self = ai;
55
57}
58
59/**********************************************************************/
63{
64 return self;
65}
66
67#define TEXAI_AIT struct ai_type *ait = texai_get_self();
68#define TEXAI_TFUNC(_func, ...) _func(ait, ## __VA_ARGS__ );
69#define TEXAI_DFUNC(_func, ...) _func(ait, ## __VA_ARGS__ );
70
71/**********************************************************************/
74static void texai_module_close(void)
75{
77
78 FC_FREE(ait->private);
79}
80
81/**********************************************************************/
84static void texwai_player_alloc(struct player *pplayer)
85{
88 /* Do not call default AI here, texai_player_alloc() does necessary parts */
89}
90
91/**********************************************************************/
94static void texwai_player_free(struct player *pplayer)
95{
98 /* Do not call default AI here, texai_player_free() does necessary parts */
99}
100
101/**********************************************************************/
104static void texwai_player_save(struct player *pplayer,
105 struct section_file *file, int plrno)
106{
107 TEXAI_AIT;
108 TEXAI_DFUNC(dai_player_save, "texai", pplayer, file, plrno);
109}
110
111/**********************************************************************/
114static void texwai_player_load(struct player *pplayer,
115 const struct section_file *file,
116 int plrno)
117{
118 TEXAI_AIT;
119 TEXAI_DFUNC(dai_player_load, "texai", pplayer, file, plrno);
120}
121
122/**********************************************************************/
125static void texwai_control_gained(struct player *pplayer)
126{
127 TEXAI_AIT;
130}
131
132/**********************************************************************/
135static void texwai_control_lost(struct player *pplayer)
136{
137 TEXAI_AIT;
139}
140
141/**********************************************************************/
144static void texwai_split_by_civil_war(struct player *original,
145 struct player *created)
146{
147 TEXAI_AIT;
149}
150
151/**********************************************************************/
154static void texwai_created_by_civil_war(struct player *original,
155 struct player *created)
156{
157 TEXAI_AIT;
159}
160
161/**********************************************************************/
164static void texwai_phase_begin(struct player *pplayer, bool is_new_phase)
165{
166 TEXAI_AIT;
168}
169
170/**********************************************************************/
173static void texwai_phase_finished(struct player *pplayer)
174{
175 TEXAI_AIT;
178}
179
180/**********************************************************************/
183static void texwai_city_alloc(struct city *pcity)
184{
185 TEXAI_AIT;
187}
188
189/**********************************************************************/
192static void texwai_city_free(struct city *pcity)
193{
194 TEXAI_AIT;
196}
197
198/**********************************************************************/
201static void texwai_city_save(struct section_file *file,
202 const struct city *pcity, const char *citystr)
203{
204 TEXAI_AIT;
205 TEXAI_DFUNC(dai_city_save, "texai", file, pcity, citystr);
206}
207
208/**********************************************************************/
211static void texwai_city_load(const struct section_file *file,
212 struct city *pcity, const char *citystr)
213{
214 TEXAI_AIT;
215 TEXAI_DFUNC(dai_city_load, "texai", file, pcity, citystr);
216}
217
218/**********************************************************************/
222 struct adv_choice *choice)
223{
224 TEXAI_AIT;
226}
227
228/**********************************************************************/
231static void texwai_wonder_city_distance(struct player *pplayer,
232 struct adv_data *adv)
233{
234 TEXAI_AIT;
236}
237
238/**********************************************************************/
241static void texwai_build_adv_init(struct player *pplayer)
242{
243 TEXAI_AIT;
245}
246
247/**********************************************************************/
250static void texwai_build_adv_adjust(struct player *pplayer,
251 struct city *wonder_city)
252{
253 TEXAI_AIT;
254 TEXAI_DFUNC(dai_build_adv_adjust, pplayer, wonder_city);
255}
256
257/**********************************************************************/
260static void texwai_gov_value(struct player *pplayer, struct government *gov,
261 adv_want *val, bool *override)
262{
263 TEXAI_AIT;
264 TEXAI_DFUNC(dai_gov_value, pplayer, gov, val, override);
265}
266
267/**********************************************************************/
275
276/**********************************************************************/
284
285/**********************************************************************/
288static void texwai_unit_alloc(struct unit *punit)
289{
290 TEXAI_AIT;
292}
293
294/**********************************************************************/
297static void texwai_unit_free(struct unit *punit)
298{
299 TEXAI_AIT;
301}
302
303/**********************************************************************/
306static void texwai_ferry_init_ferry(struct unit *ferry)
307{
308 TEXAI_AIT;
310}
311
312/**********************************************************************/
315static void texwai_ferry_transformed(struct unit *ferry,
316 const struct unit_type *old)
317{
318 TEXAI_AIT;
320}
321
322/**********************************************************************/
325static void texwai_ferry_lost(struct unit *punit)
326{
327 TEXAI_AIT;
329}
330
331/**********************************************************************/
334static void texwai_unit_turn_end(struct unit *punit)
335{
336 TEXAI_AIT;
338}
339
340/**********************************************************************/
344 struct tile *ptile,
345 struct pf_path *path, int step)
346{
347 TEXAI_AIT;
349}
350
351/**********************************************************************/
355 enum adv_unit_task task,
356 struct tile *ptile)
357{
358 TEXAI_AIT;
360}
361
362/**********************************************************************/
365static void texwai_unit_save(struct section_file *file,
366 const struct unit *punit, const char *unitstr)
367{
368 TEXAI_AIT;
369 TEXAI_DFUNC(dai_unit_save, "texai", file, punit, unitstr);
370}
371
372/**********************************************************************/
375static void texwai_unit_load(const struct section_file *file,
376 struct unit *punit, const char *unitstr)
377{
378 TEXAI_AIT;
379 TEXAI_DFUNC(dai_unit_load, "texai", file, punit, unitstr);
380}
381
382/**********************************************************************/
385static void texwai_auto_settler_reset(struct player *pplayer)
386{
387 TEXAI_AIT;
389}
390
391/**********************************************************************/
394static void texwai_auto_settler_run(struct player *pplayer,
395 struct unit *punit,
396 struct workermap *state)
397{
398 TEXAI_AIT;
399
400 /* TODO: Operate on tex map */
401 TEXAI_DFUNC(dai_auto_settler_run, &(wld.map), pplayer, punit, state);
402}
403
404/**********************************************************************/
407static void texwai_auto_settler_cont(struct player *pplayer,
408 struct unit *punit,
409 struct workermap *state)
410{
411 TEXAI_AIT;
412
413 /* TODO: Operate on tex map */
414 TEXAI_DFUNC(dai_auto_settler_cont, &(wld.map), pplayer, punit, state);
415}
416
417/**********************************************************************/
420static void texwai_switch_to_explore(struct unit *punit, struct tile *target,
421 enum override_bool *allow)
422{
423 TEXAI_AIT;
425}
426
427/**********************************************************************/
430static void texwai_first_activities(struct player *pplayer)
431{
432 TEXAI_AIT;
435}
436
437/**********************************************************************/
440static void texwai_restart_phase(struct player *pplayer)
441{
442 TEXAI_AIT;
444}
445
446/**********************************************************************/
449static void texwai_diplomacy_actions(struct player *pplayer)
450{
451 TEXAI_AIT;
453}
454
455/**********************************************************************/
458static void texwai_last_activities(struct player *pplayer)
459{
460 TEXAI_AIT;
462}
463
464/**********************************************************************/
467static void texwai_treaty_evaluate(struct player *pplayer,
468 struct player *aplayer,
469 struct treaty *ptreaty)
470{
471 TEXAI_AIT;
473}
474
475/**********************************************************************/
478static void texwai_treaty_accepted(struct player *pplayer,
479 struct player *aplayer,
480 struct treaty *ptreaty)
481{
482 TEXAI_AIT;
484}
485
486/**********************************************************************/
489static void texwai_diplomacy_first_contact(struct player *pplayer,
490 struct player *aplayer)
491{
492 TEXAI_AIT;
494}
495
496/**********************************************************************/
501 const struct action *paction,
502 struct player *receiver,
503 struct player *violator, struct player *victim)
504{
505 TEXAI_AIT;
507 receiver, violator, victim);
508}
509
510/**********************************************************************/
513static void texwai_city_log(char *buffer, int buflength,
514 const struct city *pcity)
515{
516 TEXAI_AIT;
518}
519
520/**********************************************************************/
523static void texwai_unit_log(char *buffer, int buflength,
524 const struct unit *punit)
525{
526 TEXAI_AIT;
528}
529
530/**********************************************************************/
533static void texwai_consider_plr_dangerous(struct player *plr1,
534 struct player *plr2,
535 enum override_bool *result)
536{
537 TEXAI_AIT;
538 TEXAI_DFUNC(dai_consider_plr_dangerous, plr1, plr2, result);
539}
540
541/**********************************************************************/
544static void texwai_consider_tile_dangerous(struct tile *ptile,
545 struct unit *punit,
546 enum override_bool *result)
547{
548 TEXAI_AIT;
550}
551
552/**********************************************************************/
555static void texwai_consider_wonder_city(struct city *pcity, bool *result)
556{
557 TEXAI_AIT;
559}
560
561/**********************************************************************/
564static void texwai_refresh(struct player *pplayer)
565{
566 TEXAI_AIT;
567 TEXAI_TFUNC(texai_refresh, pplayer);
568}
569
570/**********************************************************************/
573static void texwai_revolution_start(struct player *pplayer)
574{
575 TEXAI_AIT;
577}
578
579/**********************************************************************/
582static void texwai_sanity_check(struct player *pplayer)
583{
584 TEXAI_AIT;
586}
587
588/**********************************************************************/
591const char *fc_ai_tex_capstr(void)
592{
593 return FC_AI_MOD_CAPSTR;
594}
595
596/**********************************************************************/
599bool fc_ai_tex_setup(struct ai_type *ai)
600{
601 struct dai_private_data *private;
602
603 if (!has_thread_cond_impl()) {
604 log_error(_("This Freeciv compilation has no full threads "
605 "implementation, tex ai cannot be used."));
606 return FALSE;
607 }
608
609 strncpy(ai->name, "tex", sizeof(ai->name));
610
611 private = fc_malloc(sizeof(struct dai_private_data));
612 private->contemplace_workers = FALSE; /* We use custom code to set worker want and type */
613 ai->private = private;
614
615 texai_init_self(ai);
616
618
622
631
634
645
647
650
653
656
660
665
668
672
674
679
684
687
691
693
697
700
701 return TRUE;
702}
#define FC_AI_MOD_CAPSTR
Definition ai.h:27
incident_type
Definition ai.h:45
char * incite_cost
Definition comments.c:77
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:1162
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:1190
void dai_consider_wonder_city(struct ai_type *ait, struct city *pcity, bool *result)
Definition daicity.c:2095
void dai_build_adv_adjust(struct ai_type *ait, struct player *pplayer, struct city *wonder_city)
Definition daicity.c:1983
void dai_build_adv_init(struct ai_type *ait, struct player *pplayer)
Definition daicity.c:1966
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_ferry_lost(struct ai_type *ait, struct unit *punit)
Definition daiferry.c:221
void dai_ferry_transformed(struct ai_type *ait, struct unit *ferry, const struct unit_type *old)
Definition daiferry.c:189
void dai_ferry_init_ferry(struct ai_type *ait, struct unit *ferry)
Definition daiferry.c:167
void dai_do_last_activities(struct ai_type *ait, struct player *pplayer)
Definition daihand.c:774
void dai_do_first_activities(struct ai_type *ait, struct player *pplayer)
Definition daihand.c:748
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_sanity_check(struct ai_type *ait, struct player *pplayer)
Definition daisanity.c:30
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:1396
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:1093
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:3428
void dai_units_ruleset_init(struct ai_type *ait)
Definition daiunit.c:3267
void dai_switch_to_explore(struct ai_type *ait, struct unit *punit, struct tile *target, enum override_bool *allow)
Definition daiunit.c:3543
void dai_unit_turn_end(struct ai_type *ait, struct unit *punit)
Definition daiunit.c:3398
void dai_unit_init(struct ai_type *ait, struct unit *punit)
Definition daiunit.c:3376
void dai_consider_tile_dangerous(struct ai_type *ait, struct tile *ptile, struct unit *punit, enum override_bool *result)
Definition daiunit.c:3186
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:3447
void dai_unit_close(struct ai_type *ait, struct unit *punit)
Definition daiunit.c:3410
void dai_units_ruleset_close(struct ai_type *ait)
Definition daiunit.c:3358
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:1050
adv_unit_task
Definition fc_types.h:231
override_bool
Definition fc_types.h:96
#define _(String)
Definition fcintl.h:67
bool has_thread_cond_impl(void)
Definition fcthread.c:490
struct world wld
Definition game.c:63
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(* check_sanity)(struct player *pplayer)
Definition ai.h:323
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:318
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:154
static void texwai_unit_load(const struct section_file *file, struct unit *punit, const char *unitstr)
Definition texai.c:375
static void texwai_player_alloc(struct player *pplayer)
Definition texai.c:84
const char * fc_ai_tex_capstr(void)
Definition texai.c:591
static void texwai_diplomacy_first_contact(struct player *pplayer, struct player *aplayer)
Definition texai.c:489
bool fc_ai_tex_setup(struct ai_type *ai)
Definition texai.c:599
static void texwai_ferry_transformed(struct unit *ferry, const struct unit_type *old)
Definition texai.c:315
static void texwai_city_alloc(struct city *pcity)
Definition texai.c:183
static void texwai_unit_new_adv_task(struct unit *punit, enum adv_unit_task task, struct tile *ptile)
Definition texai.c:354
static void texwai_restart_phase(struct player *pplayer)
Definition texai.c:440
static void texwai_treaty_evaluate(struct player *pplayer, struct player *aplayer, struct treaty *ptreaty)
Definition texai.c:467
static void texwai_auto_settler_reset(struct player *pplayer)
Definition texai.c:385
static void texwai_consider_plr_dangerous(struct player *plr1, struct player *plr2, enum override_bool *result)
Definition texai.c:533
static void texwai_build_adv_init(struct player *pplayer)
Definition texai.c:241
static void texwai_first_activities(struct player *pplayer)
Definition texai.c:430
static void texwai_phase_finished(struct player *pplayer)
Definition texai.c:173
#define TEXAI_TFUNC(_func,...)
Definition texai.c:68
static void texwai_phase_begin(struct player *pplayer, bool is_new_phase)
Definition texai.c:164
static void texwai_sanity_check(struct player *pplayer)
Definition texai.c:582
static void texwai_gov_value(struct player *pplayer, struct government *gov, adv_want *val, bool *override)
Definition texai.c:260
static void texwai_wonder_city_distance(struct player *pplayer, struct adv_data *adv)
Definition texai.c:231
static void texwai_auto_settler_run(struct player *pplayer, struct unit *punit, struct workermap *state)
Definition texai.c:394
static void texwai_unit_log(char *buffer, int buflength, const struct unit *punit)
Definition texai.c:523
static void texwai_city_log(char *buffer, int buflength, const struct city *pcity)
Definition texai.c:513
static void texwai_city_free(struct city *pcity)
Definition texai.c:192
#define TEXAI_DFUNC(_func,...)
Definition texai.c:69
static void texwai_build_adv_override(struct city *pcity, struct adv_choice *choice)
Definition texai.c:221
static void texwai_switch_to_explore(struct unit *punit, struct tile *target, enum override_bool *allow)
Definition texai.c:420
static void texwai_last_activities(struct player *pplayer)
Definition texai.c:458
static void texwai_ferry_init_ferry(struct unit *ferry)
Definition texai.c:306
static void texwai_unit_turn_end(struct unit *punit)
Definition texai.c:334
static void texwai_consider_tile_dangerous(struct tile *ptile, struct unit *punit, enum override_bool *result)
Definition texai.c:544
static void texwai_city_save(struct section_file *file, const struct city *pcity, const char *citystr)
Definition texai.c:201
static void texwai_unit_alloc(struct unit *punit)
Definition texai.c:288
static void texwai_unit_free(struct unit *punit)
Definition texai.c:297
static void texai_init_self(struct ai_type *ai)
Definition texai.c:52
static void texwai_split_by_civil_war(struct player *original, struct player *created)
Definition texai.c:144
struct ai_type * texai_get_self(void)
Definition texai.c:62
static void texwai_player_load(struct player *pplayer, const struct section_file *file, int plrno)
Definition texai.c:114
static void texwai_city_load(const struct section_file *file, struct city *pcity, const char *citystr)
Definition texai.c:211
static void texwai_auto_settler_cont(struct player *pplayer, struct unit *punit, struct workermap *state)
Definition texai.c:407
#define TEXAI_AIT
Definition texai.c:67
static void texwai_units_ruleset_close(void)
Definition texai.c:279
static struct ai_type * self
Definition texai.c:47
static void texwai_player_free(struct player *pplayer)
Definition texai.c:94
static void texwai_unit_move_or_attack(struct unit *punit, struct tile *ptile, struct pf_path *path, int step)
Definition texai.c:343
static void texwai_build_adv_adjust(struct player *pplayer, struct city *wonder_city)
Definition texai.c:250
static void texwai_consider_wonder_city(struct city *pcity, bool *result)
Definition texai.c:555
static void texwai_units_ruleset_init(void)
Definition texai.c:270
static void texwai_control_gained(struct player *pplayer)
Definition texai.c:125
static void texwai_treaty_accepted(struct player *pplayer, struct player *aplayer, struct treaty *ptreaty)
Definition texai.c:478
static void texwai_unit_save(struct section_file *file, const struct unit *punit, const char *unitstr)
Definition texai.c:365
static void texwai_player_save(struct player *pplayer, struct section_file *file, int plrno)
Definition texai.c:104
static void texai_module_close(void)
Definition texai.c:74
static void texwai_ferry_lost(struct unit *punit)
Definition texai.c:325
static void texwai_control_lost(struct player *pplayer)
Definition texai.c:135
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:499
static void texwai_refresh(struct player *pplayer)
Definition texai.c:564
static void texwai_revolution_start(struct player *pplayer)
Definition texai.c:573
static void texwai_diplomacy_actions(struct player *pplayer)
Definition texai.c:449
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