46#define RESOURCE_NULL_IDENTIFIER '\0'
47#define RESOURCE_NONE_IDENTIFIER ' '
57#define T_UNKNOWN (NULL)
64#define MAX_NUM_TERRAINS (96)
67#define SPECENUM_NAME terrain_class
68#define SPECENUM_VALUE0 TC_LAND
70#define SPECENUM_VALUE0NAME N_("Land")
71#define SPECENUM_VALUE1 TC_OCEAN
73#define SPECENUM_VALUE1NAME N_("Oceanic")
74#define SPECENUM_COUNT TC_COUNT
82#define SPECENUM_NAME terrain_alteration
84#define SPECENUM_VALUE0 TA_CAN_IRRIGATE
88#define SPECENUM_VALUE0NAME N_("CanIrrigate")
90#define SPECENUM_VALUE1 TA_CAN_MINE
91#define SPECENUM_VALUE1NAME N_("CanMine")
93#define SPECENUM_VALUE2 TA_CAN_ROAD
94#define SPECENUM_VALUE2NAME N_("CanRoad")
96#define SPECENUM_VALUE3 TA_CAN_BASE
97#define SPECENUM_VALUE3NAME N_("CanBase")
99#define SPECENUM_VALUE4 TA_CAN_PLACE
100#define SPECENUM_VALUE4NAME N_("CanPlace")
101#define SPECENUM_COUNT TA_COUNT
105#define SPECENUM_NAME terrain_flag_id
107#define SPECENUM_VALUE0 TER_NO_BARBS
110#define SPECENUM_VALUE0NAME N_("NoBarbs")
112#define SPECENUM_VALUE1 TER_NO_CITIES
113#define SPECENUM_VALUE1NAME N_("NoCities")
115#define SPECENUM_VALUE2 TER_STARTER
116#define SPECENUM_VALUE2NAME N_("Starter")
118#define SPECENUM_VALUE3 TER_CAN_HAVE_RIVER
119#define SPECENUM_VALUE3NAME N_("CanHaveRiver")
121#define SPECENUM_VALUE4 TER_UNSAFE_COAST
122#define SPECENUM_VALUE4NAME N_("UnsafeCoast")
124#define SPECENUM_VALUE5 TER_FRESHWATER
125#define SPECENUM_VALUE5NAME N_("FreshWater")
127#define SPECENUM_VALUE6 TER_NOT_GENERATED
128#define SPECENUM_VALUE6NAME N_("NotGenerated")
130#define SPECENUM_VALUE7 TER_NO_ZOC
131#define SPECENUM_VALUE7NAME N_("NoZoc")
133#define SPECENUM_VALUE8 TER_ENTER_BORDERS
134#define SPECENUM_VALUE8NAME N_("EnterBorders")
136#define SPECENUM_VALUE9 TER_FROZEN
137#define SPECENUM_VALUE9NAME N_("Frozen")
138#define SPECENUM_VALUE10 TER_USER_1
139#define SPECENUM_VALUE11 TER_USER_2
140#define SPECENUM_VALUE12 TER_USER_3
141#define SPECENUM_VALUE13 TER_USER_4
142#define SPECENUM_VALUE14 TER_USER_5
143#define SPECENUM_VALUE15 TER_USER_6
144#define SPECENUM_VALUE16 TER_USER_7
145#define SPECENUM_VALUE17 TER_USER_8
146#define SPECENUM_VALUE18 TER_USER_9
147#define SPECENUM_VALUE19 TER_USER_LAST
148#define SPECENUM_NAMEOVERRIDE
149#define SPECENUM_BITVECTOR bv_terrain_flags
152#define MAX_NUM_USER_TER_FLAGS (TER_USER_LAST - TER_USER_1 + 1)
154#define SPECENUM_NAME mapgen_terrain_property
155#define SPECENUM_VALUE0 MG_MOUNTAINOUS
156#define SPECENUM_VALUE0NAME "mountainous"
157#define SPECENUM_VALUE1 MG_GREEN
158#define SPECENUM_VALUE1NAME "green"
159#define SPECENUM_VALUE2 MG_FOLIAGE
160#define SPECENUM_VALUE2NAME "foliage"
161#define SPECENUM_VALUE3 MG_TROPICAL
162#define SPECENUM_VALUE3NAME "tropical"
163#define SPECENUM_VALUE4 MG_TEMPERATE
164#define SPECENUM_VALUE4NAME "temperate"
165#define SPECENUM_VALUE5 MG_COLD
166#define SPECENUM_VALUE5NAME "cold"
167#define SPECENUM_VALUE6 MG_FROZEN
168#define SPECENUM_VALUE6NAME "frozen"
169#define SPECENUM_VALUE7 MG_WET
170#define SPECENUM_VALUE7NAME "wet"
171#define SPECENUM_VALUE8 MG_DRY
172#define SPECENUM_VALUE8NAME "dry"
173#define SPECENUM_VALUE9 MG_OCEAN_DEPTH
174#define SPECENUM_VALUE9NAME "ocean_depth"
175#define SPECENUM_COUNT MG_COUNT
195#define TERRAIN_UNKNOWN_IDENTIFIER 'u'
207#define RESOURCE_FREQUENCY_MINIMUM (0)
208#define RESOURCE_FREQUENCY_DEFAULT (1)
209#define RESOURCE_FREQUENCY_MAXIMUM (255)
254#define TERRAIN_OCEAN_DEPTH_MINIMUM (1)
255#define TERRAIN_OCEAN_DEPTH_MAXIMUM (100)
283#define terrain_has_flag(terr, flag) BV_ISSET((terr)->flags, flag)
286 const struct tile *ptile,
289 const struct tile *ptile,
292 const struct tile *ptile,
301#define is_ocean(pterrain) ((pterrain) != T_UNKNOWN \
302 && terrain_type_terrain_class(pterrain) == TC_OCEAN)
303#define is_ocean_tile(ptile) \
304 is_ocean(tile_terrain(ptile))
311 const struct tile *ptile,
312 const struct terrain *pterrain,
315 const struct tile *ptile,
316 const struct terrain *pterrain,
319 const struct tile *ptile,
324 const struct tile *ptile,
328 const struct tile *ptile,
358 const struct tile *ptile,
373#define terrain_type_iterate(_p) \
375 struct terrain *_p = terrain_array_first(); \
377 for (; _p <= terrain_array_last(); _p++) {
379#define terrain_type_iterate_end \
384#define terrain_re_active_iterate(_p) \
385 terrain_type_iterate(_p) { \
386 if (!_p->ruledit_disabled) {
388#define terrain_re_active_iterate_end \
390 } terrain_type_iterate_end;
392#define terrain_resources_iterate(pterrain, _res, _freq) \
393 if (NULL != pterrain && NULL != pterrain->resources) { \
395 for (_res##_index = 0; \
396 pterrain->resources[_res##_index] != NULL; \
398 struct extra_type *_res = pterrain->resources[_res##_index]; \
399 int _freq = pterrain->resource_freq[_res##_index];
401#define terrain_resources_iterate_end \
struct terrain * cultivate_result
struct terrain * cooler_wetter_result
struct extra_type ** resources
struct terrain * cooler_drier_result
struct terrain * warmer_wetter_result
char graphic_alt2[MAX_LEN_NAME]
bv_unit_classes native_to
struct name_translation name
struct terrain * plant_result
struct terrain * warmer_drier_result
const struct unit_type * animal
char graphic_alt[MAX_LEN_NAME]
char graphic_str[MAX_LEN_NAME]
enum terrain_class tclass
int road_output_incr_pct[O_LAST]
int extra_removal_times[MAX_EXTRA_TYPES]
struct terrain * transform_result
void user_terrain_flags_init(void)
struct terrain * terrain_by_rule_name(const char *name)
bool is_terrain_class_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum terrain_class tclass)
char terrain_identifier(const struct terrain *pterrain)
Terrain_type_id terrain_count(void)
struct extra_type * resource_extra_get(const struct resource_type *presource)
bool terrain_can_support_alteration(const struct terrain *pterrain, enum terrain_alteration talter)
int count_terrain_class_near_tile(const struct civ_map *nmap, const struct tile *ptile, bool cardinal_only, bool percentage, enum terrain_class tclass)
bool is_terrain_class_card_near(const struct civ_map *nmap, const struct tile *ptile, enum terrain_class tclass)
struct terrain * terrain_by_translated_name(const char *name)
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)
int const char * terrain_class_name_translation(enum terrain_class tclass)
const char * get_infrastructure_text(bv_extras extras)
Terrain_type_id terrain_index(const struct terrain *pterrain)
bool is_resource_card_near(const struct civ_map *nmap, const struct tile *ptile, const struct extra_type *pres, bool check_self)
const char * terrain_name_translation(const struct terrain *pterrain)
struct terrain * terrain_array_first(void)
struct terrain * rand_terrain_by_flag(enum terrain_flag_id flag)
struct terrain * terrain_by_number(const Terrain_type_id type)
bool is_terrain_card_near(const struct civ_map *nmap, const struct tile *ptile, const struct terrain *pterrain, bool check_self)
const char * terrain_rule_name(const struct terrain *pterrain)
bool is_resource_near_tile(const struct civ_map *nmap, const struct tile *ptile, const struct extra_type *pres, bool check_self)
void resource_types_free(void)
void user_terrain_flags_free(void)
enum terrain_class terrain_type_terrain_class(const struct terrain *pterrain)
const char * terrain_flag_helptxt(enum terrain_flag_id id)
bool terrain_has_resource(const struct terrain *pterrain, const struct extra_type *presource)
struct resource_type * resource_type_init(struct extra_type *pextra)
bool is_terrain_flag_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum terrain_flag_id flag)
struct extra_type * get_preferred_pillage(bv_extras extras)
void set_user_terrain_flag_name(enum terrain_flag_id id, const char *name, const char *helptxt)
const struct terrain * terrain_array_last(void)
int terrain_extra_build_time(const struct terrain *pterrain, enum unit_activity activity, const struct extra_type *tgt)
Terrain_type_id terrain_number(const struct terrain *pterrain)
struct terrain * terrain_by_identifier(const char identifier)
bool is_terrain_flag_card_near(const struct civ_map *nmap, const struct tile *ptile, enum terrain_flag_id flag)
int terrain_extra_removal_time(const struct terrain *pterrain, enum unit_activity activity, const struct extra_type *tgt) fc__attribute((nonnull(1
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)
bool is_terrain_near_tile(const struct civ_map *nmap, const struct tile *ptile, const struct terrain *pterrain, bool check_self)