68 if (
NULL != pterrain->helptext) {
70 pterrain->helptext =
NULL;
72 if (pterrain->resources !=
NULL) {
75 free(pterrain->resources);
76 pterrain->resources =
NULL;
78 if (pterrain->resource_freq !=
NULL) {
81 free(pterrain->resource_freq);
82 pterrain->resource_freq =
NULL;
84 if (pterrain->rgb !=
NULL) {
261 if (*r == presource) {
276 presource =
fc_malloc(
sizeof(*presource));
280 presource->
self = pextra;
298 return presource->
self;
305#define variable_adjc_iterate(nmap, center_tile, _tile, card_only) \
307 enum direction8 *_tile##_list; \
311 _tile##_list = MAP_CARDINAL_DIRS; \
312 _tile##_count = MAP_NUM_CARDINAL_DIRS; \
314 _tile##_list = MAP_VALID_DIRS; \
315 _tile##_count = MAP_NUM_VALID_DIRS; \
317 adjc_dirlist_iterate(nmap, center_tile, _tile, _tile##_dir, \
318 _tile##_list, _tile##_count) {
320#define variable_adjc_iterate_end \
321 } adjc_dirlist_iterate_end; \
328 const struct tile *ptile,
329 const struct terrain *pterrain,
332 if (pterrain ==
NULL) {
349 const struct tile *ptile,
350 const struct terrain *pterrain,
353 if (pterrain ==
NULL) {
370 const struct tile *ptile,
374 int count = 0, total = 0;
386 count = count * 100 / total;
396 const struct tile *ptile,
417 const struct tile *ptile,
439 const struct tile *ptile,
459 const struct tile *ptile,
479 const struct tile *ptile,
483 int count = 0, total = 0;
496 count = count * 100 / total;
539 if (
len > 0 && *p ==
'/') {
592 const struct tile *ptile,
613 const struct tile *ptile,
634 const struct tile *ptile,
638 int count = 0, total = 0;
651 count = count * 100 / total;
809 if (helptxt && helptxt[0] !=
'\0') {
#define BV_ISSET(bv, bit)
void user_flag_init(struct user_flag *flag)
void user_flag_free(struct user_flag *flag)
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define cardinal_adjc_iterate_end
#define adjc_iterate(nmap, center_tile, itr_tile)
#define cardinal_adjc_iterate(nmap, center_tile, itr_tile)
static const char * rule_name_get(const struct name_translation *ptrans)
static const char * name_translation_get(const struct name_translation *ptrans)
void rgbcolor_destroy(struct rgbcolor *prgbcolor)
void strvec_destroy(struct strvec *psv)
struct packet_ruleset_control control
struct extra_type ** resources
struct name_translation name
const struct unit_type * animal
enum terrain_class tclass
int extra_removal_times[MAX_EXTRA_TYPES]
int fc_strcasecmp(const char *str0, const char *str1)
int cat_snprintf(char *str, size_t n, const char *format,...)
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)
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)
const char * terrain_flag_id_name_cb(enum terrain_flag_id flag)
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)
#define variable_adjc_iterate(nmap, center_tile, _tile, card_only)
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 terrain_can_support_alteration(const struct terrain *pterrain, enum terrain_alteration alter)
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)
static struct terrain civ_terrains[MAX_NUM_TERRAINS]
int terrain_extra_build_time(const struct terrain *pterrain, enum unit_activity activity, const struct extra_type *tgt)
static struct user_flag user_terrain_flags[MAX_NUM_USER_TER_FLAGS]
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)
#define variable_adjc_iterate_end
bool is_terrain_near_tile(const struct civ_map *nmap, const struct tile *ptile, const struct terrain *pterrain, bool check_self)
#define terrain_type_iterate(_p)
#define TERRAIN_UNKNOWN_IDENTIFIER
#define terrain_type_iterate_end
#define terrain_has_flag(terr, flag)
#define MAX_NUM_USER_TER_FLAGS
#define tile_resource(_tile)
#define tile_terrain(_tile)