Freeciv-3.4
Loading...
Searching...
No Matches
daidata.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 2002 - The Freeciv Project
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 "game.h"
20#include "government.h"
21#include "map.h"
22#include "multipliers.h"
23#include "research.h"
24
25/* aicore */
26#include "aiactions.h"
27
28/* server */
29#include "cityturn.h"
30#include "plrhand.h"
31
32/* server/advisors */
33#include "advdata.h"
34
35/* ai/default */
36#include "daicity.h"
37#include "daidiplomacy.h"
38#include "daieffects.h"
39#include "daiferry.h"
40#include "daiplayer.h"
41#include "daisettler.h"
42#include "daiunit.h"
43
44#include "daidata.h"
45
46static void dai_diplomacy_new(struct ai_type *ait,
47 const struct player *plr1,
48 const struct player *plr2);
49static void dai_diplomacy_defaults(struct ai_type *ait,
50 const struct player *plr1,
51 const struct player *plr2);
52static void dai_diplomacy_destroy(struct ai_type *ait,
53 const struct player *plr1,
54 const struct player *plr2);
55
56/************************************************************************/
59void dai_data_init(struct ai_type *ait, struct player *pplayer)
60{
61 struct ai_plr *ai = def_ai_player_data(pplayer, ait);
62
64
65 ai->last_num_continents = -1;
66 ai->last_num_oceans = -1;
67
70 sizeof(*ai->diplomacy.player_intel_slots));
72 const struct ai_dip_intel **player_intel_slot
74
75 *player_intel_slot = nullptr;
77
79 /* Create ai diplomacy states for all other players */
80 dai_diplomacy_new(ait, pplayer, aplayer);
81 dai_diplomacy_defaults(ait, pplayer, aplayer);
82 /* Create ai diplomacy state of this player */
83 if (aplayer != pplayer) {
84 dai_diplomacy_new(ait, aplayer, pplayer);
85 dai_diplomacy_defaults(ait, aplayer, pplayer);
86 }
88
90 ai->diplomacy.timer = 0;
91 ai->diplomacy.love_coeff = 4; /* 4% */
92 ai->diplomacy.love_incr = MAX_AI_LOVE * 3 / 100;
95
96 ai->settler = nullptr;
97
98 /* Initialise autoworker. */
100}
101
102/************************************************************************/
105void dai_data_close(struct ai_type *ait, struct player *pplayer)
106{
107 struct ai_plr *ai = def_ai_player_data(pplayer, ait);
108
109 /* Finish the phase if it's open - free resources related to
110 * open/finish cycle */
111 dai_data_phase_finished(ait, pplayer);
112
113 /* Free autoworker. */
115
116 if (ai->diplomacy.player_intel_slots != nullptr) {
118 /* Destroy the ai diplomacy states of this player with others ... */
119 dai_diplomacy_destroy(ait, pplayer, aplayer);
120 /* ...and of others with this player. */
121 if (aplayer != pplayer) {
122 dai_diplomacy_destroy(ait, aplayer, pplayer);
123 }
126 }
127}
128
129/************************************************************************/
133bool is_ai_data_phase_open(struct ai_type *ait, struct player *pplayer)
134{
135 struct ai_plr *ai = def_ai_player_data(pplayer, ait);
136
137 return ai->phase_initialized;
138}
139
140/************************************************************************/
143void dai_data_phase_begin(struct ai_type *ait, struct player *pplayer,
144 bool is_new_phase)
145{
146 struct ai_plr *ai = def_ai_player_data(pplayer, ait);
147 bool caller_closes;
148
149 /* Note that this refreshes advisor data if needed. ai_plr_data_get()
150 is expected to refresh advisor data if needed, and ai_plr_data_get()
151 depends on this call
152 ai_plr_data_get()->ai_data_phase_begin()->adv_data_get() to do it.
153 If you change this, you may need to adjust ai_plr_data_get() also. */
154 struct adv_data *adv;
155
156 if (ai->phase_initialized) {
157 return;
158 }
159
161
162 adv = adv_data_get(pplayer, &caller_closes);
163
164 /* Store current number of known continents and oceans so we can compare
165 against it later in order to see if ai data needs refreshing. */
167 ai->last_num_oceans = adv->num_oceans;
168
169 /*** Diplomacy ***/
170 if (is_ai(pplayer) && !is_barbarian(pplayer) && is_new_phase) {
171 dai_diplomacy_begin_new_phase(ait, pplayer);
172 }
173
174 /* Set per-player variables. We must set all players, since players
175 * can be created during a turn, and we don't want those to have
176 * invalid values. */
178 struct ai_dip_intel *adip = dai_diplomacy_get(ait, pplayer, aplayer);
179
180 adip->is_allied_with_enemy = nullptr;
181 adip->at_war_with_ally = nullptr;
182 adip->is_allied_with_ally = nullptr;
183
185 if (check_pl == pplayer
186 || check_pl == aplayer
187 || !check_pl->is_alive) {
188 continue;
189 }
191 && player_diplstate_get(pplayer, check_pl)->type == DS_WAR) {
192 adip->is_allied_with_enemy = check_pl;
193 }
194 if (pplayers_allied(pplayer, check_pl)
196 adip->at_war_with_ally = check_pl;
197 }
199 && pplayers_allied(pplayer, check_pl)) {
200 adip->is_allied_with_ally = check_pl;
201 }
204
205 /*** Statistics ***/
206
207 ai->stats.workers = fc_calloc(adv->num_continents + 1, sizeof(int));
208 ai->stats.ocean_workers = fc_calloc(adv->num_oceans + 1, sizeof(int));
209 unit_list_iterate(pplayer->units, punit) {
210 struct tile *ptile = unit_tile(punit);
211
213 Continent_id cont = tile_continent(ptile);
214
215 if (is_ocean_tile(ptile)) {
216 if (cont <= 0 && -cont <= adv->num_oceans) {
217 ai->stats.ocean_workers[(int)-cont]++;
218 } else {
219 /* Always fails */
220 fc_assert(cont <= 0 && -cont <= adv->num_oceans);
221 }
222 } else {
223 if (cont >= 0 && cont <= adv->num_continents) {
224 ai->stats.workers[(int)cont]++;
225 } else {
226 /* Always fails */
227 fc_assert(cont >= 0 && cont <= adv->num_continents);
228 }
229 }
230 }
232
234 unit_list_iterate(pplayer->units, punit) {
236 && def_ai_unit_data(punit, ait)->task == AIUNIT_ATTACK) {
237
238 fc_assert_msg(punit->goto_tile != nullptr,
239 "No target city for spy action");
240
241 if (punit->goto_tile != nullptr) {
242 struct city *pcity = tile_city(punit->goto_tile);
243
244 if (pcity != nullptr) {
245 /* Heading somewhere on a mission, reserve target. */
247 }
248 }
249 }
251
252 aiferry_init_stats(ait, pplayer);
253
254 /*** Interception engine ***/
255
256 /* We are tracking a unit if punit->server.ai->cur_pos is not nullptr.
257 * If we are not tracking, start tracking by setting cur_pos.
258 * If we are, fill prev_pos with previous cur_pos. This way we get
259 * the necessary coordinates to calculate a probable trajectory. */
261 if (aplayer == pplayer) {
262 continue;
263 }
265 struct unit_ai *unit_data = def_ai_unit_data(punit, ait);
266
267 if (!unit_data->cur_pos) {
268 /* Start tracking */
269 unit_data->cur_pos = &unit_data->cur_struct;
270 unit_data->prev_pos = nullptr;
271 } else {
272 unit_data->prev_struct = unit_data->cur_struct;
273 unit_data->prev_pos = &unit_data->prev_struct;
274 }
275 *unit_data->cur_pos = unit_tile(punit);
278
279 if (caller_closes) {
280 adv_data_phase_done(pplayer);
281 }
282}
283
284/************************************************************************/
287void dai_data_phase_finished(struct ai_type *ait, struct player *pplayer)
288{
289 struct ai_plr *ai = def_ai_player_data(pplayer, ait);
290
291 if (!ai->phase_initialized) {
292 return;
293 }
294
295 free(ai->stats.workers);
296 ai->stats.workers = nullptr;
297
299 ai->stats.ocean_workers = nullptr;
300
302}
303
304/************************************************************************/
310struct ai_plr *dai_plr_data_get(struct ai_type *ait, struct player *pplayer,
311 bool *caller_closes)
312{
313 struct ai_plr *ai = def_ai_player_data(pplayer, ait);
314
315 fc_assert_ret_val(ai != nullptr, nullptr);
316
317 /* This assert really is required. See longer comment
318 in adv_data_get() for equivalent code. */
319#if defined(FREECIV_DEBUG) || defined(IS_DEVEL_VERSION)
320 fc_assert(caller_closes != nullptr || ai->phase_initialized);
321#endif
322
323 if (caller_closes != nullptr) {
325 }
326
328 || ai->last_num_oceans != wld.map.num_oceans) {
329 /* We have discovered more continents, recalculate! */
330
331 /* See adv_data_get() */
332 if (ai->phase_initialized) {
333 dai_data_phase_finished(ait, pplayer);
334 dai_data_phase_begin(ait, pplayer, FALSE);
335 } else {
336 /* Wrong order */
337 log_debug("%s ai data phase closed when dai_plr_data_get() called",
338 player_name(pplayer));
339 dai_data_phase_begin(ait, pplayer, FALSE);
340 if (caller_closes != nullptr) {
342 } else {
343 dai_data_phase_finished(ait, pplayer);
344 }
345 }
346 } else {
347 if (!ai->phase_initialized && caller_closes != nullptr) {
348 dai_data_phase_begin(ait, pplayer, FALSE);
350 }
351 }
352
353 return ai;
354}
355
356/************************************************************************/
359static void dai_diplomacy_new(struct ai_type *ait,
360 const struct player *plr1,
361 const struct player *plr2)
362{
364
365 fc_assert_ret(plr1 != nullptr);
366 fc_assert_ret(plr2 != nullptr);
367
368 const struct ai_dip_intel **player_intel_slot
370 + player_index(plr2);
371
372 fc_assert_ret(*player_intel_slot == nullptr);
373
374 player_intel = fc_calloc(1, sizeof(*player_intel));
376}
377
378/************************************************************************/
381static void dai_diplomacy_defaults(struct ai_type *ait,
382 const struct player *plr1,
383 const struct player *plr2)
384{
385 struct ai_dip_intel *player_intel = dai_diplomacy_get(ait, plr1, plr2);
386
387 fc_assert_ret(player_intel != nullptr);
388
389 /* Pseudorandom value */
390 player_intel->spam = (player_index(plr1) + player_index(plr2)) % 5;
391 player_intel->countdown = -1;
392 player_intel->war_reason = DAI_WR_NONE;
393 player_intel->distance = 1;
394 player_intel->ally_patience = 0;
395 player_intel->asked_about_peace = 0;
396 player_intel->asked_about_alliance = 0;
397 player_intel->asked_about_ceasefire = 0;
398 player_intel->warned_about_space = 0;
399}
400
401/************************************************************************/
405 const struct player *plr1,
406 const struct player *plr2)
407{
408 fc_assert_ret_val(plr1 != nullptr, nullptr);
409 fc_assert_ret_val(plr2 != nullptr, nullptr);
410
411 const struct ai_dip_intel **player_intel_slot
413 + player_index(plr2);
414
415 fc_assert_ret_val(player_intel_slot != nullptr, nullptr);
416
417 return (struct ai_dip_intel *) *player_intel_slot;
418}
419
420/************************************************************************/
423static void dai_diplomacy_destroy(struct ai_type *ait,
424 const struct player *plr1,
425 const struct player *plr2)
426{
427 fc_assert_ret(plr1 != nullptr);
428 fc_assert_ret(plr2 != nullptr);
429
430 const struct ai_dip_intel **player_intel_slot
432 + player_index(plr2);
433
434 if (*player_intel_slot != nullptr) {
435 free(dai_diplomacy_get(ait, plr1, plr2));
436 }
437
438 *player_intel_slot = nullptr;
439}
440
441/************************************************************************/
444void dai_adjust_policies(struct ai_type *ait, struct player *pplayer)
445{
447 struct adv_data *adv;
448
449 adv = adv_data_get(pplayer, nullptr);
450
452 if (multiplier_can_be_changed(ppol, pplayer)) {
453 int orig_value = 0;
454 int mp_val = player_multiplier_value(pplayer, ppol);
456 bool better_found = FALSE;
457
458 city_list_iterate(pplayer->cities, pcity) {
459 orig_value += dai_city_want(pplayer, pcity, adv, nullptr);
461
462 /* Consider reducing policy value */
463 if (mp_val > ppol->start) {
464 int new_value = 0;
465
466 pplayer->multipliers[pidx].value = MAX(mp_val - ppol->step, ppol->start);
467
468 city_list_iterate(pplayer->cities, acity) {
471
472 city_list_iterate(pplayer->cities, pcity) {
473 new_value += dai_city_want(pplayer, pcity, adv, nullptr);
475
476 if (new_value > orig_value) {
477 /* This is step to right direction, leave it in effect. */
478 pplayer->multipliers[pidx].target = pplayer->multipliers[pidx].value;
479
482 }
483 }
484
485 /* Consider increasing policy value */
486 if (!better_found && mp_val < ppol->stop) {
487 int new_value = 0;
488
489 pplayer->multipliers[pidx].value = MIN(mp_val + ppol->step, ppol->stop);
490
491 city_list_iterate(pplayer->cities, acity) {
494
495 city_list_iterate(pplayer->cities, pcity) {
496 new_value += dai_city_want(pplayer, pcity, adv, nullptr);
498
499 if (new_value > orig_value) {
500 /* This is step to right direction, leave it in effect. */
501 pplayer->multipliers[pidx].target = pplayer->multipliers[pidx].value;
502
505 }
506 }
507
508 if (!better_found) {
509 /* Restore original multiplier value */
510 pplayer->multipliers[pidx].value = mp_val;
512 }
513 }
515
517 city_list_iterate(pplayer->cities, acity) {
520 }
521}
522
523/************************************************************************/
526void dai_gov_value(struct ai_type *ait, struct player *pplayer,
527 struct government *gov, adv_want *val, bool *override)
528{
529 int dist;
530 int bonus = 0; /* in percentage */
532 struct universal source = { .kind = VUT_GOVERNMENT, .value.govern = gov };
533 struct adv_data *adv;
534 int turns = 9999; /* TODO: Set to correct value */
535 int nplayers;
536 const struct research *presearch;
537
538 /* Use default handling of no-cities case */
539 if (city_list_size(pplayer->cities) == 0) {
540 *override = FALSE;
541 return;
542 }
543
544 adv = adv_data_get(pplayer, nullptr);
545 nplayers = normal_player_count();
546 presearch = research_get(pplayer);
547
548 pplayer->government = gov;
549 /* Ideally we should change tax rates here, but since
550 * this is a rather big CPU operation, we'd rather not. */
551 check_player_max_rates(pplayer);
552 city_list_iterate(pplayer->cities, acity) {
555 city_list_iterate(pplayer->cities, pcity) {
556 bool capital;
557 const struct req_context context = { .player = pplayer, .city = pcity };
558
559 *val += dai_city_want(pplayer, pcity, adv, nullptr);
560 capital = is_capital(pcity);
561
563 bool present = TRUE;
564 bool active = TRUE;
565
567 /* Check if all the requirements for the currently evaluated effect
568 * are met, except for having the tech that we are evaluating.
569 * TODO: Consider requirements that could be met later. */
570 if (VUT_GOVERNMENT == preq->source.kind
571 && preq->source.value.govern == gov) {
572 present = preq->present;
573 continue;
574 }
575 if (!is_req_active(&context, nullptr, preq, RPT_POSSIBLE)) {
576 active = FALSE;
577 break; /* Presence doesn't matter for inactive effects. */
578 }
579
581
582 if (active) {
583 adv_want v1;
584
585 v1 = dai_effect_value(pplayer, adv, pcity, capital,
586 turns, peffect, 1,
587 nplayers);
588
589 if (!present) {
590 /* Government removes the effect */
591 *val -= v1;
592 } else {
593 *val += v1;
594 }
595 }
598
599 bonus += adv_gov_action_immunity_want(gov);
600 bonus += adv_gov_player_bonus_want(pplayer);
601
603 if (revolution_turns > 0) {
604 bonus -= 6 / revolution_turns;
605 }
606
607 *val += (*val * bonus) / 100;
608
609 /* FIXME: handle reqs other than technologies. */
610 dist = 0;
612 if (VUT_ADVANCE == preq->source.kind) {
614 advance_number(preq->source.value.advance)));
615 }
617 *val = amortize(*val, dist);
618
619 *override = TRUE;
620}
adv_want adv_gov_player_bonus_want(struct player *pplayer)
Definition advdata.c:966
struct adv_data * adv_data_get(struct player *pplayer, bool *caller_closes)
Definition advdata.c:614
void adv_data_phase_done(struct player *pplayer)
Definition advdata.c:574
adv_want adv_gov_action_immunity_want(struct government *gov)
Definition advdata.c:834
adv_want amortize(adv_want benefit, int delay)
Definition advtools.c:29
bool aia_utype_is_considered_spy_vs_city(const struct unit_type *putype)
Definition aiactions.c:27
#define BV_CLR_ALL(bv)
Definition bitvector.h:103
#define BV_SET(bv, bit)
Definition bitvector.h:89
bool is_capital(const struct city *pcity)
Definition city.c:1632
#define city_list_iterate(citylist, pcity)
Definition city.h:508
#define city_list_iterate_end
Definition city.h:510
void auto_arrange_workers(struct city *pcity)
Definition cityturn.c:367
char * incite_cost
Definition comments.c:77
adv_want dai_city_want(struct player *pplayer, struct city *acity, struct adv_data *adv, struct impr_type *pimprove)
Definition daicity.c:1453
bool is_ai_data_phase_open(struct ai_type *ait, struct player *pplayer)
Definition daidata.c:133
void dai_gov_value(struct ai_type *ait, struct player *pplayer, struct government *gov, adv_want *val, bool *override)
Definition daidata.c:526
struct ai_plr * dai_plr_data_get(struct ai_type *ait, struct player *pplayer, bool *caller_closes)
Definition daidata.c:310
static void dai_diplomacy_destroy(struct ai_type *ait, const struct player *plr1, const struct player *plr2)
Definition daidata.c:423
void dai_adjust_policies(struct ai_type *ait, struct player *pplayer)
Definition daidata.c:444
static void dai_diplomacy_new(struct ai_type *ait, const struct player *plr1, const struct player *plr2)
Definition daidata.c:359
struct ai_dip_intel * dai_diplomacy_get(struct ai_type *ait, const struct player *plr1, const struct player *plr2)
Definition daidata.c:404
void dai_data_init(struct ai_type *ait, struct player *pplayer)
Definition daidata.c:59
void dai_data_phase_begin(struct ai_type *ait, struct player *pplayer, bool is_new_phase)
Definition daidata.c:143
static void dai_diplomacy_defaults(struct ai_type *ait, const struct player *plr1, const struct player *plr2)
Definition daidata.c:381
void dai_data_phase_finished(struct ai_type *ait, struct player *pplayer)
Definition daidata.c:287
void dai_data_close(struct ai_type *ait, struct player *pplayer)
Definition daidata.c:105
@ WIN_OPEN
Definition daidata.h:32
void dai_diplomacy_begin_new_phase(struct ai_type *ait, struct player *pplayer)
adv_want dai_effect_value(struct player *pplayer, const struct adv_data *adv, const struct city *pcity, const bool capital, int turns, const struct effect *peffect, const int c, const int nplayers)
Definition daieffects.c:138
void aiferry_init_stats(struct ai_type *ait, struct player *pplayer)
Definition daiferry.c:92
static struct ai_plr * def_ai_player_data(const struct player *pplayer, struct ai_type *deftype)
Definition daiplayer.h:54
static struct unit_ai * def_ai_unit_data(const struct unit *punit, struct ai_type *deftype)
Definition daiplayer.h:48
void dai_auto_settler_init(struct ai_plr *ai)
void dai_auto_settler_free(struct ai_plr *ai)
@ AIUNIT_ATTACK
Definition daiunit.h:28
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:73
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:77
struct effect_list * get_req_source_effects(const struct universal *psource)
Definition effects.c:153
int get_player_bonus(const struct player *pplayer, enum effect_type effect_type)
Definition effects.c:824
#define effect_list_iterate_end
Definition effects.h:81
#define effect_list_iterate(effect_list, peffect)
Definition effects.h:79
float adv_want
Definition fc_types.h:1050
@ RPT_POSSIBLE
Definition fc_types.h:515
signed short Continent_id
Definition fc_types.h:233
struct world wld
Definition game.c:63
static GtkWidget * source
Definition gotodlg.c:58
GType type
Definition repodlgs.c:1313
#define fc_assert_msg(condition, message,...)
Definition log.h:182
#define fc_assert_ret(condition)
Definition log.h:192
#define fc_assert(condition)
Definition log.h:177
#define fc_assert_ret_val(condition, val)
Definition log.h:195
#define log_debug(message,...)
Definition log.h:116
#define fc_calloc(n, esz)
Definition mem.h:38
bool multiplier_can_be_changed(struct multiplier *pmul, struct player *pplayer)
Multiplier_type_id multiplier_index(const struct multiplier *pmul)
Definition multipliers.c:80
#define multipliers_iterate(_mul_)
Definition multipliers.h:61
#define multipliers_iterate_end
Definition multipliers.h:67
int player_slot_count(void)
Definition player.c:415
int player_multiplier_value(const struct player *pplayer, const struct multiplier *pmul)
Definition player.c:1947
const char * player_name(const struct player *pplayer)
Definition player.c:885
int player_slot_index(const struct player_slot *pslot)
Definition player.c:423
int player_index(const struct player *pplayer)
Definition player.c:818
struct player_diplstate * player_diplstate_get(const struct player *plr1, const struct player *plr2)
Definition player.c:325
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
Definition player.c:1397
#define players_iterate_end
Definition player.h:552
#define players_iterate(_pplayer)
Definition player.h:547
#define MAX_AI_LOVE
Definition player.h:576
static bool is_barbarian(const struct player *pplayer)
Definition player.h:499
#define player_slots_iterate(_pslot)
Definition player.h:538
#define is_ai(plr)
Definition player.h:232
#define players_iterate_alive_end
Definition player.h:562
#define player_slots_iterate_end
Definition player.h:542
#define players_iterate_alive(_pplayer)
Definition player.h:557
int normal_player_count(void)
Definition plrhand.c:3217
void check_player_max_rates(struct player *pplayer)
Definition plrhand.c:776
bool is_req_active(const struct req_context *context, const struct req_context *other_context, const struct requirement *req, const enum req_problem_type prob_type)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
int research_goal_unknown_techs(const struct research *presearch, Tech_type_id goal)
Definition research.c:753
struct research * research_get(const struct player *pplayer)
Definition research.c:130
#define MIN(x, y)
Definition shared.h:55
#define MAX(x, y)
Definition shared.h:54
adv_want val
Definition advdata.h:132
int num_oceans
Definition advdata.h:110
int num_continents
Definition advdata.h:109
struct government * gov
Definition advdata.h:131
int * ocean_workers
Definition daidata.h:83
int last_num_oceans
Definition daidata.h:75
int * workers
Definition daidata.h:82
int last_num_continents
Definition daidata.h:74
bool phase_initialized
Definition daidata.h:72
struct ai_plr::@280 diplomacy
struct ai_settler * settler
Definition daidata.h:101
int req_love_for_alliance
Definition daidata.h:96
struct ai_plr::@279 stats
int timer
Definition daidata.h:92
char love_incr
Definition daidata.h:94
char love_coeff
Definition daidata.h:93
bv_id diplomat_reservations
Definition daidata.h:85
const struct ai_dip_intel ** player_intel_slots
Definition daidata.h:90
int req_love_for_peace
Definition daidata.h:95
enum winning_strategy strategy
Definition daidata.h:91
Definition ai.h:50
Definition city.h:318
Continent_id num_continents
Definition map_types.h:83
Continent_id num_oceans
Definition map_types.h:84
struct requirement_vector reqs
Definition government.h:64
struct city_list * cities
Definition player.h:281
struct government * government
Definition player.h:258
struct unit_list * units
Definition player.h:282
bool is_alive
Definition player.h:268
struct multiplier_value multipliers[MAX_NUM_MULTIPLIERS]
Definition player.h:314
const struct player * player
Definition tile.h:50
int id
Definition unit.h:146
struct tile * goto_tile
Definition unit.h:156
enum universals_n kind
Definition fc_types.h:595
struct civ_map map
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47
Tech_type_id advance_number(const struct advance *padvance)
Definition tech.c:100
#define is_ocean_tile(ptile)
Definition terrain.h:197
struct city * tile_city(const struct tile *ptile)
Definition tile.c:83
#define tile_continent(_tile)
Definition tile.h:93
#define unit_tile(_pu)
Definition unit.h:408
#define unit_list_iterate(unitlist, punit)
Definition unitlist.h:31
#define unit_list_iterate_end
Definition unitlist.h:33
const struct unit_type * unit_type_get(const struct unit *punit)
Definition unittype.c:126
bool unit_has_type_flag(const struct unit *punit, enum unit_type_flag_id flag)
Definition unittype.c:215