Freeciv-3.2: /fast/freeciv/nightly/S3_2/server/generator/startpos.c Source File

Freeciv-3.2

Loading...
Searching...
No Matches
startpos.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - 2004 The Freeciv Project Team
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#include <math.h> /* sqrt, HUGE_VAL */
19
20/* utility */
21#include "log.h"
22#include "fcintl.h"
23
24/* common */
25#include "game.h"
26#include "map.h"
27#include "movement.h"
28
29/* server */
30#include "maphand.h"
31
32/* server/generator */
33#include "mapgen_topology.h"
34#include "mapgen_utils.h"
35#include "startpos.h"
36#include "temperature_map.h"
37
38 struct islands_data_type {
39 Continent_id id;
40 int size;
41 int goodies;
42 int starters;
43 int total;
44};
45 static struct islands_data_type *islands;
46 static int *islands_index;
47
48/************************************************************************/
51 static int get_tile_value(struct tile *ptile)
52{
53 int value;
54 int irrig_bonus = 0;
55 int mine_bonus = 0;
56 struct tile *roaded;
57 struct extra_type *nextra;
58
59 /* Give one point for each food / shield / trade produced. */
60 value = 0;
61 output_type_iterate(o) {
62 value += city_tile_output(NULL, ptile, FALSE, o);
63 } output_type_iterate_end;
64
65 roaded = tile_virtual_new(ptile);
66
67 if (num_role_units(L_SETTLERS) > 0) {
68 const struct req_context start_worker_ctxt = {
69 .tile = roaded,
70 .unittype = get_role_unit(L_SETTLERS, 0),
71 };
72
73 extra_type_by_cause_iterate(EC_ROAD, pextra) {
74 struct road_type *proad = extra_road_get(pextra);
75
76 if (road_can_be_built(proad, roaded)
77 && are_reqs_active(&start_worker_ctxt, NULL,
78 &pextra->reqs, RPT_CERTAIN)) {
79 tile_add_extra(roaded, pextra);
80 }
81 } extra_type_by_cause_iterate_end;
82 }
83
84 nextra = next_extra_for_tile(roaded, EC_IRRIGATION, NULL, NULL);
85
86 if (nextra != NULL) {
87 struct tile *vtile;
88
89 vtile = tile_virtual_new(roaded);
90 tile_apply_activity(vtile, ACTIVITY_IRRIGATE, nextra);
91 irrig_bonus = -value;
92 output_type_iterate(o) {
93 irrig_bonus += city_tile_output(NULL, vtile, FALSE, o);
94 } output_type_iterate_end;
95 tile_virtual_destroy(vtile);
96 }
97
98 nextra = next_extra_for_tile(roaded, EC_MINE, NULL, NULL);
99
100 /* Same set of roads used with mine as with irrigation. */
101 if (nextra != NULL) {
102 struct tile *vtile;
103
104 vtile = tile_virtual_new(roaded);
105 tile_apply_activity(vtile, ACTIVITY_MINE, nextra);
106 mine_bonus = -value;
107 output_type_iterate(o) {
108 mine_bonus += city_tile_output(NULL, vtile, FALSE, o);
109 } output_type_iterate_end;
110 tile_virtual_destroy(vtile);
111 }
112
113 tile_virtual_destroy(roaded);
114
115 value += MAX(0, MAX(mine_bonus, irrig_bonus)) / 2;
116
117 return value;
118}
119
120 struct start_filter_data {
121 int min_value;
122 struct unit_type *initial_unit;
123 int *value;
124};
125
126/************************************************************************/
130 static bool check_native_area(const struct unit_type *utype,
131 const struct tile *ptile,
132 int min_area)
133{
134 int tiles = 1; /* There's the central tile already. */
135 struct tile_list *tlist = tile_list_new();
136 struct tile *central = tile_virtual_new(ptile); /* Non-const virtual tile */
137 struct dbv handled;
138
139 dbv_init(&handled, MAP_INDEX_SIZE);
140
141 tile_list_append(tlist, central);
142
143 while (tile_list_size(tlist) > 0 && tiles < min_area) {
144 tile_list_iterate(tlist, ptile2) {
145 adjc_iterate(&(wld.map), ptile2, ptile3) {
146 int idx = tile_index(ptile3);
147
148 if (!dbv_isset(&handled, idx) && is_native_tile(utype, ptile3)) {
149 tiles++;
150 tile_list_append(tlist, ptile3);
151 dbv_set(&handled, idx);
152 if (tiles >= min_area) {
153 /* Break out when we already know that area is sufficient. */
154 break;
155 }
156 }
157 } adjc_iterate_end;
158
159 tile_list_remove(tlist, ptile2);
160
161 if (tiles >= min_area) {
162 /* Break out when we already know that area is sufficient. */
163 break;
164 }
165 } tile_list_iterate_end;
166 }
167
168 tile_list_destroy(tlist);
169
170 dbv_free(&handled);
171
172 tile_virtual_destroy(central);
173
174 return tiles >= min_area;
175}
176
177/************************************************************************/
187 static bool is_valid_start_pos(const struct tile *ptile, const void *dataptr)
188{
189 const struct start_filter_data *pdata = dataptr;
190 struct islands_data_type *island;
191 int cont_size, cont = tile_continent(ptile);
192
193 /* Only start on certain terrain types. */
194 if (pdata->value[tile_index(ptile)] < pdata->min_value) {
195 return FALSE;
196 }
197
198 fc_assert_ret_val(cont > 0, FALSE);
199 if (islands[islands_index[cont]].starters == 0) {
200 return FALSE;
201 }
202
203 /* Don't start on a hut. */
204 /* FIXME: Could be ok for unit not entering or frightening hut */
205 if (hut_on_tile(ptile)) {
206 return FALSE;
207 }
208
209 /* Has to be native tile for initial unit */
210 if (!is_native_tile(pdata->initial_unit, ptile)) {
211 return FALSE;
212 }
213
214 /* Check native area size. */
215 if (!check_native_area(pdata->initial_unit, ptile,
216 terrain_control.min_start_native_area)) {
217 return FALSE;
218 }
219
220 if (game.server.start_city && terrain_has_flag(tile_terrain(ptile), TER_NO_CITIES)) {
221 return FALSE;
222 }
223
224 /* A longstanding bug allowed starting positions to exist on poles,
225 * sometimes. This hack prevents it by setting a fixed distance from
226 * the pole (dependent on map temperature) that a start pos must be.
227 * Cold and frozen tiles are not allowed for start pos placement. */
228 if (tmap_is(ptile, TT_NHOT)) {
229 return FALSE;
230 }
231
232 /* Don't start too close to someone else. */
233 cont_size = get_continent_size(cont);
234 island = islands + islands_index[cont];
235 map_startpos_iterate(psp) {
236 struct tile *tile1 = startpos_tile(psp);
237
238 if ((tile_continent(ptile) == tile_continent(tile1)
239 && (real_map_distance(ptile, tile1) * 1000 / pdata->min_value
240 <= (sqrt(cont_size / island->total))))
241 || (real_map_distance(ptile, tile1) * 1000 / pdata->min_value < 5)) {
242 return FALSE;
243 }
244 } map_startpos_iterate_end;
245
246 return TRUE;
247}
248
249/************************************************************************/
252 static int compare_islands(const void *A_, const void *B_)
253{
254 const struct islands_data_type *A = A_, *B = B_;
255
256 return B->goodies - A->goodies;
257}
258
259/************************************************************************/
262 static void initialize_isle_data(void)
263{
264 int nr;
265
266 islands = fc_malloc((wld.map.num_continents + 1) * sizeof(*islands));
267 islands_index = fc_malloc((wld.map.num_continents + 1)
268 * sizeof(*islands_index));
269
270 /* islands[0] is unused. */
271 for (nr = 1; nr <= wld.map.num_continents; nr++) {
272 islands[nr].id = nr;
273 islands[nr].size = get_continent_size(nr);
274 islands[nr].goodies = 0;
275 islands[nr].starters = 0;
276 islands[nr].total = 0;
277 }
278}
279
280/************************************************************************/
283 static bool filter_starters(const struct tile *ptile, const void *data)
284{
285 return terrain_has_flag(tile_terrain(ptile), TER_STARTER);
286}
287
288/************************************************************************/
300 bool create_start_positions(enum map_startpos mode,
301 struct unit_type *initial_unit)
302{
303 struct tile *ptile;
304 int k, sum;
305 struct start_filter_data data;
306 int *tile_value_aux = NULL;
307 int *tile_value = NULL;
308 int min_goodies_per_player = 1500;
309 int total_goodies = 0;
310 /* This is factor is used to maximize land used in extreme little maps */
311 float efactor = player_count() / map_size_checked() / 4;
312 bool failure = FALSE;
313 bool is_tmap = temperature_is_initialized();
314 const struct civ_map *nmap = &(wld.map);
315
316 if (wld.map.num_continents < 1) {
317 /* Currently we can only place starters on land terrain, so fail
318 * immediately if there isn't any on the map. */
319 log_verbose("Map has no land, so cannot assign start positions!");
320 return FALSE;
321 }
322
323 if (!is_tmap) {
324 /* The temperature map has already been destroyed by the time start
325 * positions have been placed. We check for this and then create a
326 * false temperature map. This is used in the tmap_is() call above.
327 * We don't create a "real" map here because that requires the height
328 * map and other information which has already been destroyed. */
329 create_tmap(FALSE);
330 }
331
332 /* If the default is given, just use MAPSTARTPOS_VARIABLE. */
333 if (MAPSTARTPOS_DEFAULT == mode) {
334 log_verbose("Using startpos=VARIABLE");
335 mode = MAPSTARTPOS_VARIABLE;
336 }
337
338 tile_value_aux = fc_calloc(MAP_INDEX_SIZE, sizeof(*tile_value_aux));
339 tile_value = fc_calloc(MAP_INDEX_SIZE, sizeof(*tile_value));
340
341 /* Get the tile value */
342 whole_map_iterate(&(wld.map), value_tile) {
343 tile_value_aux[tile_index(value_tile)] = get_tile_value(value_tile);
344 } whole_map_iterate_end;
345
346 /* Select the best tiles */
347 whole_map_iterate(&(wld.map), value_tile) {
348 int this_tile_value = tile_value_aux[tile_index(value_tile)];
349 int lcount = 0, bcount = 0;
350
351 /* Check all tiles within the default city radius */
352 city_tile_iterate(nmap, CITY_MAP_DEFAULT_RADIUS_SQ, value_tile, ptile1) {
353 if (this_tile_value > tile_value_aux[tile_index(ptile1)]) {
354 lcount++;
355 } else if (this_tile_value < tile_value_aux[tile_index(ptile1)]) {
356 bcount++;
357 }
358 } city_tile_iterate_end;
359
360 if (lcount <= bcount) {
361 this_tile_value = 0;
362 }
363 tile_value[tile_index(value_tile)] = 100 * this_tile_value;
364 } whole_map_iterate_end;
365 /* Get an average value */
366 smooth_int_map(tile_value, TRUE);
367
368 initialize_isle_data();
369
370 /* Only consider tiles marked as 'starter terrains' by ruleset */
371 whole_map_iterate(&(wld.map), starter_tile) {
372 if (!filter_starters(starter_tile, NULL)) {
373 tile_value[tile_index(starter_tile)] = 0;
374 } else {
375 /* Oceanic terrain cannot be starter terrain currently */
376 fc_assert_action(tile_continent(starter_tile) > 0, continue);
377 islands[tile_continent(starter_tile)].goodies += tile_value[tile_index(starter_tile)];
378 total_goodies += tile_value[tile_index(starter_tile)];
379 }
380 } whole_map_iterate_end;
381
382 /* evaluate the best places on the map */
383 adjust_int_map_filtered(tile_value, 0, 1000, NULL, filter_starters);
384
385 /* Sort the islands so the best ones come first. Note that islands[0] is
386 * unused so we just skip it. */
387 qsort(islands + 1, wld.map.num_continents,
388 sizeof(*islands), compare_islands);
389
390 /* If we can't place starters according to the first choice, change the
391 * choice. */
392 if (MAPSTARTPOS_SINGLE == mode
393 && wld.map.num_continents < player_count() + 3) {
394 log_verbose("Not enough continents; falling back to startpos=2or3");
395 mode = MAPSTARTPOS_2or3;
396 }
397
398 if (MAPSTARTPOS_2or3 == mode
399 && wld.map.num_continents < player_count() / 2 + 4) {
400 log_verbose("Not enough continents; falling back to startpos=VARIABLE");
401 mode = MAPSTARTPOS_VARIABLE;
402 }
403
404 if (MAPSTARTPOS_ALL == mode
405 && (islands[1].goodies < player_count() * min_goodies_per_player
406 || islands[1].goodies < total_goodies * (0.5 + 0.8 * efactor)
407 / (1 + efactor))) {
408 log_verbose("No good enough island; falling back to startpos=VARIABLE");
409 mode = MAPSTARTPOS_VARIABLE;
410 }
411
412 /* the variable way is the last possibility */
413 if (MAPSTARTPOS_VARIABLE == mode) {
414 min_goodies_per_player = total_goodies * (0.65 + 0.8 * efactor)
415 / (1 + efactor) / player_count();
416 }
417
418 {
419 int nr, to_place = player_count(), first = 1;
420
421 /* inizialize islands_index */
422 for (nr = 1; nr <= wld.map.num_continents; nr++) {
423 islands_index[islands[nr].id] = nr;
424 }
425
426 /* When placing a fixed number of players per island, for fairness, try
427 * to avoid sets of populated islands where there is more than 10%
428 * variation in "goodness" within the entire set. (Fallback if that fails:
429 * place players on the worst available islands.) */
430 if (MAPSTARTPOS_SINGLE == mode || MAPSTARTPOS_2or3 == mode) {
431 float var_goodies, best = HUGE_VAL;
432 int num_islands = (MAPSTARTPOS_SINGLE == mode
433 ? player_count() : player_count() / 2);
434
435 for (nr = 1; nr <= 1 + wld.map.num_continents - num_islands; nr++) {
436 if (islands[nr + num_islands - 1].goodies < min_goodies_per_player) {
437 break;
438 }
439 var_goodies
440 = (islands[nr].goodies - islands[nr + num_islands - 1].goodies)
441 / (islands[nr + num_islands - 1].goodies);
442
443 if (var_goodies < best * 0.9) {
444 best = var_goodies;
445 first = nr;
446 }
447 }
448 }
449
450 /* set starters per isle */
451 if (MAPSTARTPOS_ALL == mode) {
452 islands[1].starters = to_place;
453 islands[1].total = to_place;
454 to_place = 0;
455 }
456 for (nr = 1; nr <= wld.map.num_continents; nr++) {
457 if (MAPSTARTPOS_SINGLE == mode && 0 < to_place && nr >= first) {
458 islands[nr].starters = 1;
459 islands[nr].total = 1;
460 to_place--;
461 }
462 if (MAPSTARTPOS_2or3 == mode && 0 < to_place && nr >= first) {
463 islands[nr].starters = 2 + (nr == 1 ? (player_count() % 2) : 0);
464 to_place -= islands[nr].total = islands[nr].starters;
465 }
466
467 if (MAPSTARTPOS_VARIABLE == mode && 0 < to_place) {
468 islands[nr].starters = MAX(1, islands[nr].goodies
469 / MAX(1, min_goodies_per_player));
470 to_place -= islands[nr].total = islands[nr].starters;
471 }
472 }
473 }
474
475 data.value = tile_value;
476 data.min_value = 900;
477 data.initial_unit = initial_unit;
478 sum = 0;
479 for (k = 1; k <= wld.map.num_continents; k++) {
480 sum += islands[islands_index[k]].starters;
481 if (islands[islands_index[k]].starters != 0) {
482 log_verbose("starters on isle %i", k);
483 }
484 }
485 fc_assert_ret_val(player_count() <= sum, FALSE);
486
487 /* now search for the best place and set start_positions */
488 while (map_startpos_count() < player_count()) {
489 if ((ptile = rand_map_pos_filtered(&(wld.map), &data,
490 is_valid_start_pos))) {
491 islands[islands_index[(int) tile_continent(ptile)]].starters--;
492 log_debug("Adding (%d, %d) as starting position %d, %d goodies on "
493 "islands.", TILE_XY(ptile), map_startpos_count(),
494 islands[islands_index[(int) tile_continent(ptile)]].goodies);
495 (void) map_startpos_new(ptile);
496 } else {
497 data.min_value *= 0.95;
498 if (data.min_value <= 10) {
499 log_normal(_("The server appears to have gotten into an infinite "
500 "loop in the allocation of starting positions.\nMaybe "
501 "the number of players is too high for this map."));
502 failure = TRUE;
503 break;
504 }
505 }
506 }
507
508 free(islands);
509 free(islands_index);
510 islands = NULL;
511 islands_index = NULL;
512
513 if (!is_tmap) {
514 destroy_tmap();
515 }
516
517 FC_FREE(tile_value_aux);
518 FC_FREE(tile_value);
519
520 return !failure;
521}
dbv_init
void dbv_init(struct dbv *pdbv, int bits)
Definition bitvector.c:50
dbv_set
void dbv_set(struct dbv *pdbv, int bit)
Definition bitvector.c:144
dbv_isset
bool dbv_isset(const struct dbv *pdbv, int bit)
Definition bitvector.c:120
dbv_free
void dbv_free(struct dbv *pdbv)
Definition bitvector.c:95
city_tile_output
int city_tile_output(const struct city *pcity, const struct tile *ptile, bool is_celebrating, Output_type_id otype)
Definition city.c:1274
output_type_iterate
#define output_type_iterate(output)
Definition city.h:833
city_tile_iterate
#define city_tile_iterate(_nmap, _radius_sq, _city_tile, _tile)
Definition city.h:230
CITY_MAP_DEFAULT_RADIUS_SQ
#define CITY_MAP_DEFAULT_RADIUS_SQ
Definition city.h:82
city_tile_iterate_end
#define city_tile_iterate_end
Definition city.h:238
output_type_iterate_end
#define output_type_iterate_end
Definition city.h:839
incite_cost
char * incite_cost
Definition comments.c:74
next_extra_for_tile
struct extra_type * next_extra_for_tile(const struct tile *ptile, enum extra_cause cause, const struct player *pplayer, const struct unit *punit)
Definition extras.c:765
hut_on_tile
bool hut_on_tile(const struct tile *ptile)
Definition extras.c:697
extra_road_get
#define extra_road_get(_e_)
Definition extras.h:191
extra_type_by_cause_iterate_end
#define extra_type_by_cause_iterate_end
Definition extras.h:339
extra_type_by_cause_iterate
#define extra_type_by_cause_iterate(_cause, _extra)
Definition extras.h:333
RPT_CERTAIN
@ RPT_CERTAIN
Definition fc_types.h:704
Continent_id
signed short Continent_id
Definition fc_types.h:375
fcintl.h
_
#define _(String)
Definition fcintl.h:67
game
struct civ_game game
Definition game.c:62
wld
struct world wld
Definition game.c:63
game.h
log.h
log_verbose
#define log_verbose(message,...)
Definition log.h:109
fc_assert_ret_val
#define fc_assert_ret_val(condition, val)
Definition log.h:194
fc_assert_action
#define fc_assert_action(condition, action)
Definition log.h:187
log_debug
#define log_debug(message,...)
Definition log.h:115
log_normal
#define log_normal(message,...)
Definition log.h:107
map_startpos_new
struct startpos * map_startpos_new(struct tile *ptile)
Definition map.c:1866
startpos_tile
struct tile * startpos_tile(const struct startpos *psp)
Definition map.c:1676
rand_map_pos_filtered
struct tile * rand_map_pos_filtered(const struct civ_map *nmap, void *data, bool(*filter)(const struct tile *ptile, const void *data))
Definition map.c:1101
map_startpos_count
int map_startpos_count(void)
Definition map.c:1853
real_map_distance
int real_map_distance(const struct tile *tile0, const struct tile *tile1)
Definition map.c:630
terrain_control
struct terrain_misc terrain_control
Definition map.c:69
map.h
map_startpos_iterate
#define map_startpos_iterate(NAME_psp)
Definition map.h:130
adjc_iterate_end
#define adjc_iterate_end
Definition map.h:433
MAP_INDEX_SIZE
#define MAP_INDEX_SIZE
Definition map.h:137
adjc_iterate
#define adjc_iterate(nmap, center_tile, itr_tile)
Definition map.h:428
map_startpos_iterate_end
#define map_startpos_iterate_end
Definition map.h:133
whole_map_iterate
#define whole_map_iterate(_map, _tile)
Definition map.h:545
map_size_checked
#define map_size_checked()
Definition map.h:271
whole_map_iterate_end
#define whole_map_iterate_end
Definition map.h:554
map_startpos
map_startpos
Definition map_types.h:55
MAPSTARTPOS_VARIABLE
@ MAPSTARTPOS_VARIABLE
Definition map_types.h:60
MAPSTARTPOS_2or3
@ MAPSTARTPOS_2or3
Definition map_types.h:58
MAPSTARTPOS_ALL
@ MAPSTARTPOS_ALL
Definition map_types.h:59
MAPSTARTPOS_DEFAULT
@ MAPSTARTPOS_DEFAULT
Definition map_types.h:56
MAPSTARTPOS_SINGLE
@ MAPSTARTPOS_SINGLE
Definition map_types.h:57
mapgen_topology.h
get_continent_size
int get_continent_size(Continent_id id)
Definition mapgen_utils.c:428
smooth_int_map
void smooth_int_map(int *int_map, bool zeroes_at_edges)
Definition mapgen_utils.c:191
adjust_int_map_filtered
void adjust_int_map_filtered(int *int_map, int int_map_min, int int_map_max, void *data, bool(*filter)(const struct tile *ptile, const void *data))
Definition mapgen_utils.c:123
mapgen_utils.h
maphand.h
fc_calloc
#define fc_calloc(n, esz)
Definition mem.h:38
FC_FREE
#define FC_FREE(ptr)
Definition mem.h:41
fc_malloc
#define fc_malloc(sz)
Definition mem.h:34
is_native_tile
bool is_native_tile(const struct unit_type *punittype, const struct tile *ptile)
Definition movement.c:331
movement.h
player_count
int player_count(void)
Definition player.c:817
are_reqs_active
bool are_reqs_active(const struct req_context *context, const struct player *other_player, const struct requirement_vector *reqs, const enum req_problem_type prob_type)
Definition requirements.c:5505
road_can_be_built
bool road_can_be_built(const struct road_type *proad, const struct tile *ptile)
Definition road.c:200
MAX
#define MAX(x, y)
Definition shared.h:54
compare_islands
static int compare_islands(const void *A_, const void *B_)
Definition startpos.c:252
create_start_positions
bool create_start_positions(enum map_startpos mode, struct unit_type *initial_unit)
Definition startpos.c:300
filter_starters
static bool filter_starters(const struct tile *ptile, const void *data)
Definition startpos.c:283
initialize_isle_data
static void initialize_isle_data(void)
Definition startpos.c:262
islands_index
static int * islands_index
Definition startpos.c:46
islands
static struct islands_data_type * islands
Definition startpos.c:45
get_tile_value
static int get_tile_value(struct tile *ptile)
Definition startpos.c:51
check_native_area
static bool check_native_area(const struct unit_type *utype, const struct tile *ptile, int min_area)
Definition startpos.c:130
is_valid_start_pos
static bool is_valid_start_pos(const struct tile *ptile, const void *dataptr)
Definition startpos.c:187
startpos.h
civ_game::server
struct civ_game::@31::@35 server
civ_game::start_city
bool start_city
Definition game.h:190
civ_map
Definition map_types.h:71
civ_map::num_continents
int num_continents
Definition map_types.h:81
dbv
Definition bitvector.h:32
extra_type
Definition extras.h:88
islands_data_type
Definition startpos.c:38
islands_data_type::total
int total
Definition startpos.c:43
islands_data_type::goodies
int goodies
Definition startpos.c:41
islands_data_type::size
int size
Definition startpos.c:40
islands_data_type::id
Continent_id id
Definition startpos.c:39
islands_data_type::starters
int starters
Definition startpos.c:42
req_context
Definition requirements.h:100
req_context::tile
const struct tile * tile
Definition requirements.h:103
road_type
Definition road.h:71
start_filter_data
Definition startpos.c:120
start_filter_data::value
int * value
Definition startpos.c:123
start_filter_data::min_value
int min_value
Definition startpos.c:121
start_filter_data::initial_unit
struct unit_type * initial_unit
Definition startpos.c:122
tile
Definition tile.h:50
unit_type
Definition unittype.h:500
world::map
struct civ_map map
Definition world_object.h:38
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47
temperature_is_initialized
bool temperature_is_initialized(void)
Definition temperature_map.c:77
destroy_tmap
void destroy_tmap(void)
Definition temperature_map.c:107
tmap_is
bool tmap_is(const struct tile *ptile, temperature_type tt)
Definition temperature_map.c:85
create_tmap
void create_tmap(bool real)
Definition temperature_map.c:119
temperature_map.h
TT_NHOT
#define TT_NHOT
Definition temperature_map.h:33
terrain_has_flag
#define terrain_has_flag(terr, flag)
Definition terrain.h:283
tile_add_extra
void tile_add_extra(struct tile *ptile, const struct extra_type *pextra)
Definition tile.c:955
tile_virtual_destroy
void tile_virtual_destroy(struct tile *vtile)
Definition tile.c:1033
tile_apply_activity
bool tile_apply_activity(struct tile *ptile, Activity_type_id act, struct extra_type *tgt)
Definition tile.c:681
tile_virtual_new
struct tile * tile_virtual_new(const struct tile *ptile)
Definition tile.c:981
tile_index
#define tile_index(_pt_)
Definition tile.h:88
tile_list_iterate
#define tile_list_iterate(tile_list, ptile)
Definition tile.h:73
tile_terrain
#define tile_terrain(_tile)
Definition tile.h:110
TILE_XY
#define TILE_XY(ptile)
Definition tile.h:43
tile_list_iterate_end
#define tile_list_iterate_end
Definition tile.h:75
tile_continent
#define tile_continent(_tile)
Definition tile.h:92
get_role_unit
struct unit_type * get_role_unit(int role, int role_index)
Definition unittype.c:2253
num_role_units
int num_role_units(int role)
Definition unittype.c:2203