Freeciv-3.4
Loading...
Searching...
No Matches
terrain.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 2003 - 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/* utility */
19#include "fcintl.h"
20#include "log.h" /* fc_assert */
21#include "mem.h" /* free */
22#include "rand.h"
23#include "shared.h"
24#include "string_vector.h"
25#include "support.h"
26
27/* common */
28#include "extras.h"
29#include "game.h"
30#include "map.h"
31#include "rgbcolor.h"
32#include "road.h"
33
34#include "terrain.h"
35
38
39/**********************************************************************/
42void terrains_init(void)
43{
44 int i;
45
46 for (i = 0; i < ARRAY_SIZE(civ_terrains); i++) {
47 int j;
48
49 /* Can't use terrain_by_number here because it does a bounds check. */
52 civ_terrains[i].ruledit_dlg = nullptr;
53 civ_terrains[i].rgb = nullptr;
54
55 for (j = 0; j < MAX_EXTRA_TYPES; j++) {
57 }
58 }
59}
60
61/**********************************************************************/
64void terrains_free(void)
65{
66 terrain_type_iterate(pterrain) {
67 if (pterrain->helptext != nullptr) {
68 strvec_destroy(pterrain->helptext);
69 pterrain->helptext = nullptr;
70 }
71 if (pterrain->resources != nullptr) {
72 /* Server allocates this on ruleset loading, client when
73 * ruleset packet is received. */
74 free(pterrain->resources);
75 pterrain->resources = nullptr;
76 }
77 if (pterrain->resource_freq != nullptr) {
78 /* Server allocates this on ruleset loading, client when
79 * ruleset packet is received. */
80 free(pterrain->resource_freq);
81 pterrain->resource_freq = nullptr;
82 }
83 if (pterrain->rgb != nullptr) {
84 /* Server allocates this on ruleset loading, client when
85 * ruleset packet is received. */
86 rgbcolor_destroy(pterrain->rgb);
87 pterrain->rgb = nullptr;
88 }
90}
91
92/**********************************************************************/
96{
97 if (game.control.terrain_count > 0) {
98 return civ_terrains;
99 }
100
101 return nullptr;
102}
103
104/**********************************************************************/
107const struct terrain *terrain_array_last(void)
108{
109 if (game.control.terrain_count > 0) {
111 }
112
113 return nullptr;
114}
115
116/**********************************************************************/
123
124/**********************************************************************/
127char terrain_identifier(const struct terrain *pterrain)
128{
129 fc_assert_ret_val(pterrain, '\0');
130 return pterrain->identifier;
131}
132
133/**********************************************************************/
139Terrain_type_id terrain_index(const struct terrain *pterrain)
140{
141 fc_assert_ret_val(pterrain, -1);
142 return pterrain - civ_terrains;
143}
144
145/**********************************************************************/
149{
150 fc_assert_ret_val(pterrain, -1);
151 return pterrain->item_number;
152}
153
154/**********************************************************************/
158{
160 /* This isn't an error; some T_UNKNOWN callers depend on it. */
161 return nullptr;
162 }
163
164 return &civ_terrains[type];
165}
166
167/**********************************************************************/
172{
174 return T_UNKNOWN;
175 }
176 terrain_type_iterate(pterrain) {
177 if (pterrain->identifier == identifier) {
178 return pterrain;
179 }
181
182 return T_UNKNOWN;
183}
184
185/**********************************************************************/
189{
190 const char *qname = Qn_(name);
191
192 terrain_type_iterate(pterrain) {
193 if (0 == fc_strcasecmp(terrain_rule_name(pterrain), qname)) {
194 return pterrain;
195 }
197
198 return T_UNKNOWN;
199}
200
201/**********************************************************************/
205{
206 terrain_type_iterate(pterrain) {
207 if (0 == strcmp(terrain_name_translation(pterrain), name)) {
208 return pterrain;
209 }
211
212 return T_UNKNOWN;
213}
214
215/**********************************************************************/
220{
221 int num = 0;
222 struct terrain *terr = nullptr;
223
225 if (terrain_has_flag(pterr, flag)) {
226 num++;
227 if (fc_rand(num) == 1) {
228 terr = pterr;
229 }
230 }
232
233 return terr;
234}
235
236/**********************************************************************/
240const char *terrain_name_translation(const struct terrain *pterrain)
241{
242 return name_translation_get(&pterrain->name);
243}
244
245/**********************************************************************/
249const char *terrain_rule_name(const struct terrain *pterrain)
250{
251 return rule_name_get(&pterrain->name);
252}
253
254/**********************************************************************/
257bool terrain_has_resource(const struct terrain *pterrain,
258 const struct extra_type *presource)
259{
260 struct extra_type **r = pterrain->resources;
261
262 while (*r != nullptr) {
263 if (*r == presource) {
264 return TRUE;
265 }
266 r++;
267 }
268
269 return FALSE;
270}
271
272/**********************************************************************/
276{
277 struct resource_type *presource;
278
279 presource = fc_malloc(sizeof(*presource));
280
281 pextra->data.resource = presource;
282
283 presource->self = pextra;
284
285 return presource;
286}
287
288/**********************************************************************/
292{
293 /* Resource structure itself is freed as part of extras destruction. */
294}
295
296/**********************************************************************/
299struct extra_type *resource_extra_get(const struct resource_type *presource)
300{
301 return presource->self;
302}
303
304/**********************************************************************/
308#define variable_adjc_iterate(nmap, center_tile, _tile, card_only) \
309{ \
310 enum direction8 *_tile##_list; \
311 int _tile##_count; \
312 \
313 if (card_only) { \
314 _tile##_list = MAP_CARDINAL_DIRS; \
315 _tile##_count = MAP_NUM_CARDINAL_DIRS; \
316 } else { \
317 _tile##_list = MAP_VALID_DIRS; \
318 _tile##_count = MAP_NUM_VALID_DIRS; \
319 } \
320 adjc_dirlist_iterate(nmap, center_tile, _tile, _tile##_dir, \
321 _tile##_list, _tile##_count) {
322
323#define variable_adjc_iterate_end \
324 } adjc_dirlist_iterate_end; \
325}
326
327/**********************************************************************/
331 const struct tile *ptile,
332 const struct terrain *pterrain,
333 bool check_self)
334{
335 if (pterrain == nullptr) {
336 return FALSE;
337 }
338
340 if (tile_terrain(adjc_tile) == pterrain) {
341 return TRUE;
342 }
344
345 return check_self && ptile->terrain == pterrain;
346}
347
348/**********************************************************************/
352 const struct tile *ptile,
353 const struct terrain *pterrain,
354 bool check_self)
355{
356 if (pterrain == nullptr) {
357 return FALSE;
358 }
359
360 adjc_iterate(nmap, ptile, adjc_tile) {
361 if (tile_terrain(adjc_tile) == pterrain) {
362 return TRUE;
363 }
365
366 return check_self && ptile->terrain == pterrain;
367}
368
369/**********************************************************************/
373 const struct tile *ptile,
374 bool cardinal_only, bool percentage,
376{
377 int count = 0, total = 0;
378
380 struct terrain *pterrain = tile_terrain(adjc_tile);
381
382 if (pterrain->property[prop] > 0) {
383 count++;
384 }
385 total++;
387
388 if (percentage && count > 0) { /* Latter condition avoids div by zero */
389 count = count * 100 / total;
390 }
391
392 return count;
393}
394
395/**********************************************************************/
399 const struct tile *ptile,
400 const struct extra_type *pres,
401 bool check_self)
402{
403 if (pres == nullptr) {
404 return FALSE;
405 }
406
408 if (tile_resource(adjc_tile) == pres) {
409 return TRUE;
410 }
412
413 return check_self && tile_resource(ptile) == pres;
414}
415
416/**********************************************************************/
420 const struct tile *ptile,
421 const struct extra_type *pres,
422 bool check_self)
423{
424 if (pres == nullptr) {
425 return FALSE;
426 }
427
428 adjc_iterate(nmap, ptile, adjc_tile) {
429 if (tile_resource(adjc_tile) == pres) {
430 return TRUE;
431 }
433
434 return check_self && tile_resource(ptile) == pres;
435}
436
437/**********************************************************************/
442 const struct tile *ptile,
443 enum terrain_flag_id flag)
444{
446 struct terrain* pterrain = tile_terrain(adjc_tile);
447
448 if (T_UNKNOWN != pterrain
449 && terrain_has_flag(pterrain, flag)) {
450 return TRUE;
451 }
453
454 return FALSE;
455}
456
457/**********************************************************************/
462 const struct tile *ptile,
463 enum terrain_flag_id flag)
464{
465 adjc_iterate(nmap, ptile, adjc_tile) {
466 struct terrain* pterrain = tile_terrain(adjc_tile);
467
468 if (T_UNKNOWN != pterrain
469 && terrain_has_flag(pterrain, flag)) {
470 return TRUE;
471 }
473
474 return FALSE;
475}
476
477/**********************************************************************/
482 const struct tile *ptile,
483 bool cardinal_only, bool percentage,
484 enum terrain_flag_id flag)
485{
486 int count = 0, total = 0;
487
489 struct terrain *pterrain = tile_terrain(adjc_tile);
490
491 if (T_UNKNOWN != pterrain
492 && terrain_has_flag(pterrain, flag)) {
493 count++;
494 }
495 total++;
497
498 if (percentage && count > 0) { /* Latter condition avoids div by zero */
499 count = count * 100 / total;
500 }
501
502 return count;
503}
504
505/**********************************************************************/
512{
513 static char s[256];
514 char *p;
515 int len;
516
517 s[0] = '\0';
518
519 extra_type_iterate(pextra) {
520 if (pextra->category == ECAT_INFRA
521 && BV_ISSET(extras, extra_index(pextra))) {
522 bool hidden = FALSE;
523
524 extra_type_iterate(top) {
525 int topi = extra_index(top);
526
527 if (BV_ISSET(pextra->hidden_by, topi)
528 && BV_ISSET(extras, topi)) {
529 hidden = TRUE;
530 break;
531 }
533
534 if (!hidden) {
535 cat_snprintf(s, sizeof(s), "%s/", extra_name_translation(pextra));
536 }
537 }
539
540 len = strlen(s);
541 p = s + len - 1;
542 if (len > 0 && *p == '/') {
543 *p = '\0';
544 }
545
546 return s;
547}
548
549/**********************************************************************/
554{
555 /* Semi-arbitrary preference order reflecting previous behavior */
556 static const enum extra_cause prefs[] = {
558 EC_MINE,
559 EC_BASE,
560 EC_ROAD,
561 EC_HUT,
566 EC_NONE
567 };
568 int i;
569
570 for (i = 0; i < ARRAY_SIZE(prefs); i++) {
573 && BV_ISSET(extras, extra_index(pextra))) {
574 return pextra;
575 }
577 }
578
579 return nullptr;
580}
581
582/**********************************************************************/
586{
587 return pterrain->tclass;
588}
589
590/**********************************************************************/
595 const struct tile *ptile,
596 enum terrain_class tclass)
597{
599 struct terrain* pterrain = tile_terrain(adjc_tile);
600
601 if (pterrain != T_UNKNOWN) {
602 if (terrain_type_terrain_class(pterrain) == tclass) {
603 return TRUE;
604 }
605 }
607
608 return FALSE;
609}
610
611/**********************************************************************/
616 const struct tile *ptile,
618{
619 adjc_iterate(nmap, ptile, adjc_tile) {
620 struct terrain* pterrain = tile_terrain(adjc_tile);
621
622 if (pterrain != T_UNKNOWN) {
623 if (terrain_type_terrain_class(pterrain) == tclass) {
624 return TRUE;
625 }
626 }
628
629 return FALSE;
630}
631
632/**********************************************************************/
637 const struct tile *ptile,
638 bool cardinal_only, bool percentage,
640{
641 int count = 0, total = 0;
642
644 struct terrain *pterrain = tile_terrain(adjc_tile);
645
646 if (T_UNKNOWN != pterrain
647 && terrain_type_terrain_class(pterrain) == tclass) {
648 count++;
649 }
650 total++;
652
653 if (percentage && count > 0) { /* Latter condition avoids div by zero */
654 count = count * 100 / total;
655 }
656
657 return count;
658}
659
660/**********************************************************************/
665{
667 return nullptr;
668 }
669
670 return _(terrain_class_name(tclass));
671}
672
673/**********************************************************************/
676bool terrain_can_support_alteration(const struct terrain *pterrain,
678{
679 switch (alter) {
680 case TA_CAN_IRRIGATE:
681 return (pterrain->irrigation_time > 0);
682 case TA_CAN_MINE:
683 return (pterrain->mining_time > 0);
684 case TA_CAN_ROAD:
685 return (pterrain->road_time > 0);
686 case TA_CAN_BASE:
687 return (pterrain->base_time > 0);
688 case TA_CAN_PLACE:
689 return (pterrain->placing_time > 0);
690 default:
691 break;
692 }
693
695
696 return FALSE;
697}
698
699/**********************************************************************/
702int terrain_extra_build_time(const struct terrain *pterrain,
703 enum unit_activity activity,
704 const struct extra_type *tgt)
705{
706 int factor;
707
708 if (tgt != nullptr && tgt->build_time != 0) {
709 /* Extra specific build time */
710 return tgt->build_time;
711 }
712
713 if (tgt == nullptr) {
714 factor = 1;
715 } else {
716 factor = tgt->build_time_factor;
717 }
718
719 /* Terrain and activity specific build time */
720 switch (activity) {
721 case ACTIVITY_BASE:
722 return pterrain->base_time * factor;
724 return pterrain->road_time * factor;
726 return pterrain->irrigation_time * factor;
727 case ACTIVITY_MINE:
728 return pterrain->mining_time * factor;
729 default:
731 return 0;
732 }
733}
734
735/**********************************************************************/
738int terrain_extra_removal_time(const struct terrain *pterrain,
739 enum unit_activity activity,
740 const struct extra_type *tgt)
741{
742 int factor;
743
744 if (tgt->removal_time != 0) {
745 /* Extra specific removal time */
746 return tgt->removal_time;
747 }
748
749 factor = tgt->removal_time_factor;
750
751 /* Terrain and activity specific removal time */
752 switch (activity) {
753 case ACTIVITY_CLEAN:
754 return pterrain->extra_removal_times[extra_index(tgt)] * factor;
755 case ACTIVITY_PILLAGE:
756 return pterrain->pillage_time * factor;
757 default:
759
760 return 0;
761 }
762}
763
764/**********************************************************************/
768{
769 int i;
770
771 for (i = 0; i < MAX_NUM_USER_TER_FLAGS; i++) {
773 }
774}
775
776/**********************************************************************/
780{
781 int i;
782
783 for (i = 0; i < MAX_NUM_USER_TER_FLAGS; i++) {
785 }
786}
787
788/**********************************************************************/
792 const char *helptxt)
793{
794 int tfid = id - TER_USER_1;
795
796 fc_assert_ret(id >= TER_USER_1 && id <= TER_USER_LAST);
797
798 if (user_terrain_flags[tfid].name != nullptr) {
800 user_terrain_flags[tfid].name = nullptr;
801 }
802
803 if (name && name[0] != '\0') {
805 }
806
807 if (user_terrain_flags[tfid].helptxt != nullptr) {
810 }
811
812 if (helptxt && helptxt[0] != '\0') {
814 }
815}
816
817/**********************************************************************/
821{
823 return nullptr;
824 }
825
827}
828
829/**********************************************************************/
833{
834 fc_assert(id >= TER_USER_1 && id <= TER_USER_LAST);
835
837}
#define BV_ISSET(bv, bit)
Definition bitvector.h:86
char * incite_cost
Definition comments.c:77
static struct extra_type extras[MAX_EXTRA_TYPES]
Definition extras.c:31
bool is_extra_removed_by(const struct extra_type *pextra, enum extra_rmcause rmcause)
Definition extras.c:353
const char * extra_name_translation(const struct extra_type *pextra)
Definition extras.c:194
#define extra_type_by_cause_iterate_rev(_cause, _extra)
Definition extras.h:344
#define extra_type_by_cause_iterate_rev_end
Definition extras.h:349
#define extra_type_iterate(_p)
Definition extras.h:315
#define extra_type_iterate_end
Definition extras.h:321
#define extra_index(_e_)
Definition extras.h:183
int Terrain_type_id
Definition fc_types.h:234
#define EC_NONE
Definition fc_types.h:808
#define MAX_EXTRA_TYPES
Definition fc_types.h:50
#define _(String)
Definition fcintl.h:67
#define Qn_(String)
Definition fcintl.h:89
void user_flag_init(struct user_flag *flag)
Definition game.c:832
void user_flag_free(struct user_flag *flag)
Definition game.c:841
struct civ_game game
Definition game.c:62
GType type
Definition repodlgs.c:1313
const char * name
Definition inputfile.c:127
#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 adjc_iterate_end
Definition map.h:430
#define cardinal_adjc_iterate_end
Definition map.h:456
#define adjc_iterate(nmap, center_tile, itr_tile)
Definition map.h:425
#define cardinal_adjc_iterate(nmap, center_tile, itr_tile)
Definition map.h:452
#define FC_FREE(ptr)
Definition mem.h:41
#define fc_strdup(str)
Definition mem.h:43
#define fc_malloc(sz)
Definition mem.h:34
static const char * rule_name_get(const struct name_translation *ptrans)
static const char * name_translation_get(const struct name_translation *ptrans)
int len
Definition packhand.c:128
#define fc_rand(_size)
Definition rand.h:56
void rgbcolor_destroy(struct rgbcolor *prgbcolor)
Definition rgbcolor.c:74
#define ARRAY_SIZE(x)
Definition shared.h:85
void strvec_destroy(struct strvec *psv)
struct packet_ruleset_control control
Definition game.h:83
struct resource_type * resource
Definition extras.h:156
int removal_time
Definition extras.h:120
int build_time_factor
Definition extras.h:119
struct extra_type::@26 data
int removal_time_factor
Definition extras.h:121
int build_time
Definition extras.h:118
struct extra_type * self
Definition terrain.h:56
int placing_time
Definition terrain.h:120
int property[MG_COUNT]
Definition terrain.h:147
struct extra_type ** resources
Definition terrain.h:97
int item_number
Definition terrain.h:76
int road_time
Definition terrain.h:106
struct name_translation name
Definition terrain.h:77
int pillage_time
Definition terrain.h:125
int mining_time
Definition terrain.h:118
struct rgbcolor * rgb
Definition terrain.h:155
enum terrain_class tclass
Definition terrain.h:90
int extra_removal_times[MAX_EXTRA_TYPES]
Definition terrain.h:128
int irrigation_time
Definition terrain.h:115
int base_time
Definition terrain.h:105
void * ruledit_dlg
Definition terrain.h:79
char identifier
Definition terrain.h:84
bool ruledit_disabled
Definition terrain.h:78
Definition tile.h:50
struct terrain * terrain
Definition tile.h:57
char * name
Definition game.h:74
char * helptxt
Definition game.h:75
int fc_strcasecmp(const char *str0, const char *str1)
Definition support.c:186
int cat_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:986
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47
int terrain_extra_removal_time(const struct terrain *pterrain, enum unit_activity activity, const struct extra_type *tgt)
Definition terrain.c:738
void user_terrain_flags_init(void)
Definition terrain.c:767
void terrains_free(void)
Definition terrain.c:64
struct terrain * terrain_by_rule_name(const char *name)
Definition terrain.c:188
bool is_terrain_class_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum terrain_class tclass)
Definition terrain.c:615
char terrain_identifier(const struct terrain *pterrain)
Definition terrain.c:127
Terrain_type_id terrain_count(void)
Definition terrain.c:119
void terrains_init(void)
Definition terrain.c:42
struct extra_type * resource_extra_get(const struct resource_type *presource)
Definition terrain.c:299
int count_terrain_class_near_tile(const struct civ_map *nmap, const struct tile *ptile, bool cardinal_only, bool percentage, enum terrain_class tclass)
Definition terrain.c:636
bool is_terrain_class_card_near(const struct civ_map *nmap, const struct tile *ptile, enum terrain_class tclass)
Definition terrain.c:594
struct terrain * terrain_by_translated_name(const char *name)
Definition terrain.c:204
const char * terrain_class_name_translation(enum terrain_class tclass)
Definition terrain.c:664
int count_terrain_flag_near_tile(const struct civ_map *nmap, const struct tile *ptile, bool cardinal_only, bool percentage, enum terrain_flag_id flag)
Definition terrain.c:481
const char * get_infrastructure_text(bv_extras extras)
Definition terrain.c:511
const char * terrain_flag_id_name_cb(enum terrain_flag_id flag)
Definition terrain.c:820
Terrain_type_id terrain_index(const struct terrain *pterrain)
Definition terrain.c:139
bool is_resource_card_near(const struct civ_map *nmap, const struct tile *ptile, const struct extra_type *pres, bool check_self)
Definition terrain.c:398
const char * terrain_name_translation(const struct terrain *pterrain)
Definition terrain.c:240
#define variable_adjc_iterate(nmap, center_tile, _tile, card_only)
Definition terrain.c:308
struct terrain * terrain_array_first(void)
Definition terrain.c:95
struct terrain * rand_terrain_by_flag(enum terrain_flag_id flag)
Definition terrain.c:219
struct terrain * terrain_by_number(const Terrain_type_id type)
Definition terrain.c:157
bool terrain_can_support_alteration(const struct terrain *pterrain, enum terrain_alteration alter)
Definition terrain.c:676
bool is_terrain_card_near(const struct civ_map *nmap, const struct tile *ptile, const struct terrain *pterrain, bool check_self)
Definition terrain.c:330
const char * terrain_rule_name(const struct terrain *pterrain)
Definition terrain.c:249
bool is_resource_near_tile(const struct civ_map *nmap, const struct tile *ptile, const struct extra_type *pres, bool check_self)
Definition terrain.c:419
void resource_types_free(void)
Definition terrain.c:291
void user_terrain_flags_free(void)
Definition terrain.c:779
enum terrain_class terrain_type_terrain_class(const struct terrain *pterrain)
Definition terrain.c:585
const char * terrain_flag_helptxt(enum terrain_flag_id id)
Definition terrain.c:832
bool terrain_has_resource(const struct terrain *pterrain, const struct extra_type *presource)
Definition terrain.c:257
struct resource_type * resource_type_init(struct extra_type *pextra)
Definition terrain.c:275
bool is_terrain_flag_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum terrain_flag_id flag)
Definition terrain.c:461
struct extra_type * get_preferred_pillage(bv_extras extras)
Definition terrain.c:553
void set_user_terrain_flag_name(enum terrain_flag_id id, const char *name, const char *helptxt)
Definition terrain.c:791
const struct terrain * terrain_array_last(void)
Definition terrain.c:107
static struct terrain civ_terrains[MAX_NUM_TERRAINS]
Definition terrain.c:36
int terrain_extra_build_time(const struct terrain *pterrain, enum unit_activity activity, const struct extra_type *tgt)
Definition terrain.c:702
static struct user_flag user_terrain_flags[MAX_NUM_USER_TER_FLAGS]
Definition terrain.c:37
Terrain_type_id terrain_number(const struct terrain *pterrain)
Definition terrain.c:148
struct terrain * terrain_by_identifier(const char identifier)
Definition terrain.c:171
bool is_terrain_flag_card_near(const struct civ_map *nmap, const struct tile *ptile, enum terrain_flag_id flag)
Definition terrain.c:441
int count_terrain_property_near_tile(const struct civ_map *nmap, const struct tile *ptile, bool cardinal_only, bool percentage, enum mapgen_terrain_property prop)
Definition terrain.c:372
#define variable_adjc_iterate_end
Definition terrain.c:323
bool is_terrain_near_tile(const struct civ_map *nmap, const struct tile *ptile, const struct terrain *pterrain, bool check_self)
Definition terrain.c:351
#define terrain_type_iterate(_p)
Definition terrain.h:267
#define T_UNKNOWN
Definition terrain.h:62
#define TERRAIN_UNKNOWN_IDENTIFIER
Definition terrain.h:88
#define terrain_type_iterate_end
Definition terrain.h:273
#define MAX_NUM_TERRAINS
Definition terrain.h:69
#define terrain_has_flag(terr, flag)
Definition terrain.h:177
#define MAX_NUM_USER_TER_FLAGS
Definition terrain.h:32
#define tile_resource(_tile)
Definition tile.h:103
#define tile_terrain(_tile)
Definition tile.h:115