46#define RESOURCE_NULL_IDENTIFIER '\0'
47#define RESOURCE_NONE_IDENTIFIER ' '
57#define T_UNKNOWN (NULL)
64#define MAX_NUM_TERRAINS (96)
67#define MAX_RESOURCE_TYPES (MAX_NUM_TERRAINS / 2)
70#define SPECENUM_NAME terrain_class
71#define SPECENUM_VALUE0 TC_LAND
73#define SPECENUM_VALUE0NAME N_("Land")
74#define SPECENUM_VALUE1 TC_OCEAN
76#define SPECENUM_VALUE1NAME N_("Oceanic")
77#define SPECENUM_COUNT TC_COUNT
85#define SPECENUM_NAME terrain_alteration
87#define SPECENUM_VALUE0 TA_CAN_IRRIGATE
91#define SPECENUM_VALUE0NAME N_("CanIrrigate")
93#define SPECENUM_VALUE1 TA_CAN_MINE
94#define SPECENUM_VALUE1NAME N_("CanMine")
96#define SPECENUM_VALUE2 TA_CAN_ROAD
97#define SPECENUM_VALUE2NAME N_("CanRoad")
98#define SPECENUM_COUNT TA_COUNT
102#define SPECENUM_NAME terrain_flag_id
104#define SPECENUM_VALUE0 TER_NO_BARBS
107#define SPECENUM_VALUE0NAME N_("NoBarbs")
109#define SPECENUM_VALUE1 TER_NO_CITIES
110#define SPECENUM_VALUE1NAME N_("NoCities")
112#define SPECENUM_VALUE2 TER_STARTER
113#define SPECENUM_VALUE2NAME N_("Starter")
115#define SPECENUM_VALUE3 TER_CAN_HAVE_RIVER
116#define SPECENUM_VALUE3NAME N_("CanHaveRiver")
118#define SPECENUM_VALUE4 TER_UNSAFE_COAST
119#define SPECENUM_VALUE4NAME N_("UnsafeCoast")
121#define SPECENUM_VALUE5 TER_FRESHWATER
122#define SPECENUM_VALUE5NAME N_("FreshWater")
124#define SPECENUM_VALUE6 TER_NOT_GENERATED
125#define SPECENUM_VALUE6NAME N_("NotGenerated")
127#define SPECENUM_VALUE7 TER_NO_ZOC
128#define SPECENUM_VALUE7NAME N_("NoZoc")
130#define SPECENUM_VALUE8 TER_FROZEN
131#define SPECENUM_VALUE8NAME N_("Frozen")
132#define SPECENUM_VALUE9 TER_USER_1
133#define SPECENUM_VALUE10 TER_USER_2
134#define SPECENUM_VALUE11 TER_USER_3
135#define SPECENUM_VALUE12 TER_USER_4
136#define SPECENUM_VALUE13 TER_USER_5
137#define SPECENUM_VALUE14 TER_USER_6
138#define SPECENUM_VALUE15 TER_USER_7
139#define SPECENUM_VALUE16 TER_USER_8
140#define SPECENUM_VALUE17 TER_USER_9
141#define SPECENUM_VALUE18 TER_USER_LAST
142#define SPECENUM_NAMEOVERRIDE
143#define SPECENUM_BITVECTOR bv_terrain_flags
146#define MAX_NUM_USER_TER_FLAGS (TER_USER_LAST - TER_USER_1 + 1)
148#define SPECENUM_NAME mapgen_terrain_property
149#define SPECENUM_VALUE0 MG_MOUNTAINOUS
150#define SPECENUM_VALUE0NAME "mountainous"
151#define SPECENUM_VALUE1 MG_GREEN
152#define SPECENUM_VALUE1NAME "green"
153#define SPECENUM_VALUE2 MG_FOLIAGE
154#define SPECENUM_VALUE2NAME "foliage"
155#define SPECENUM_VALUE3 MG_TROPICAL
156#define SPECENUM_VALUE3NAME "tropical"
157#define SPECENUM_VALUE4 MG_TEMPERATE
158#define SPECENUM_VALUE4NAME "temperate"
159#define SPECENUM_VALUE5 MG_COLD
160#define SPECENUM_VALUE5NAME "cold"
161#define SPECENUM_VALUE6 MG_FROZEN
162#define SPECENUM_VALUE6NAME "frozen"
163#define SPECENUM_VALUE7 MG_WET
164#define SPECENUM_VALUE7NAME "wet"
165#define SPECENUM_VALUE8 MG_DRY
166#define SPECENUM_VALUE8NAME "dry"
167#define SPECENUM_VALUE9 MG_OCEAN_DEPTH
168#define SPECENUM_VALUE9NAME "ocean_depth"
169#define SPECENUM_COUNT MG_COUNT
188#define TERRAIN_UNKNOWN_IDENTIFIER 'u'
239 int property[MG_COUNT];
240#define TERRAIN_OCEAN_DEPTH_MINIMUM (1)
241#define TERRAIN_OCEAN_DEPTH_MAXIMUM (100)
269#define terrain_has_flag(terr, flag) BV_ISSET((terr)->flags, flag)
272 const struct tile *ptile,
273 enum terrain_flag_id flag);
275 const struct tile *ptile,
276 enum terrain_flag_id flag);
278 const struct tile *ptile,
279 bool cardinal_only,
bool percentage,
280 enum terrain_flag_id flag);
287#define is_ocean(pterrain) ((pterrain) != T_UNKNOWN \
288 && terrain_type_terrain_class(pterrain) == TC_OCEAN)
289#define is_ocean_tile(ptile) \
290 is_ocean(tile_terrain(ptile))
297 const struct tile *ptile,
298 const struct terrain *pterrain,
301 const struct tile *ptile,
302 const struct terrain *pterrain,
305 const struct tile *ptile,
306 bool cardinal_only,
bool percentage,
307 enum mapgen_terrain_property prop);
310 const struct tile *ptile,
314 const struct tile *ptile,
328 enum unit_activity activity,
331 enum unit_activity activity,
339 const struct tile *ptile,
enum terrain_class tclass);
341 const struct tile *ptile,
enum terrain_class tclass);
343 const struct tile *ptile,
344 bool cardinal_only,
bool percentage,
345 enum terrain_class tclass);
349 enum terrain_alteration talter);
358#define terrain_type_iterate(_p) \
360 struct terrain *_p = terrain_array_first(); \
362 for (; _p <= terrain_array_last(); _p++) {
364#define terrain_type_iterate_end \
369#define terrain_re_active_iterate(_p) \
370 terrain_type_iterate(_p) { \
371 if (!_p->ruledit_disabled) {
373#define terrain_re_active_iterate_end \
375 } terrain_type_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
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]
struct terrain * transform_result
int terrain_extra_removal_time(const struct terrain *pterrain, enum unit_activity activity, const struct extra_type *tgt)
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)
const char * terrain_class_name_translation(enum terrain_class tclass)
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)
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 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)