30#include "terrain_enums_gen.h"
32#define MAX_NUM_USER_TER_FLAGS (TER_USER_LAST - TER_USER_1 + 1)
51#define RESOURCE_NULL_IDENTIFIER '\0'
52#define RESOURCE_NONE_IDENTIFIER ' '
62#define T_UNKNOWN (NULL)
69#define MAX_NUM_TERRAINS (96)
88#define TERRAIN_UNKNOWN_IDENTIFIER 'u'
100#define RESOURCE_FREQUENCY_MINIMUM (0)
101#define RESOURCE_FREQUENCY_DEFAULT (1)
102#define RESOURCE_FREQUENCY_MAXIMUM (255)
147#define TERRAIN_OCEAN_DEPTH_MINIMUM (1)
148#define TERRAIN_OCEAN_DEPTH_MAXIMUM (100)
176#define terrain_has_flag(terr, flag) BV_ISSET((terr)->flags, flag)
179 const struct tile *ptile,
182 const struct tile *ptile,
185 const struct tile *ptile,
194#define is_ocean(pterrain) ((pterrain) != T_UNKNOWN \
195 && terrain_type_terrain_class(pterrain) == TC_OCEAN)
196#define is_ocean_tile(ptile) \
197 is_ocean(tile_terrain(ptile))
204 const struct tile *ptile,
205 const struct terrain *pterrain,
208 const struct tile *ptile,
209 const struct terrain *pterrain,
212 const struct tile *ptile,
217 const struct tile *ptile,
221 const struct tile *ptile,
251 const struct tile *ptile,
266#define terrain_type_iterate(_p) \
268 struct terrain *_p = terrain_array_first(); \
270 for (; _p <= terrain_array_last(); _p++) {
272#define terrain_type_iterate_end \
277#define terrain_re_active_iterate(_p) \
278 terrain_type_iterate(_p) { \
279 if (!_p->ruledit_disabled) {
281#define terrain_re_active_iterate_end \
283 } terrain_type_iterate_end;
285#define terrain_resources_iterate(pterrain, _res, _freq) \
286 if (NULL != pterrain && NULL != pterrain->resources) { \
288 for (_res##_index = 0; \
289 pterrain->resources[_res##_index] != NULL; \
291 struct extra_type *_res = pterrain->resources[_res##_index]; \
292 int _freq = pterrain->resource_freq[_res##_index];
294#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)