Freeciv-3.2: /fast/freeciv/nightly/S3_2/common/terrain.h Source File

Freeciv-3.2

Loading...
Searching...
No Matches
terrain.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
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#ifndef FC__TERRAIN_H
14#define FC__TERRAIN_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20/* utility */
21#include "bitvector.h"
22#include "shared.h"
23
24/* common */
25#include "fc_types.h"
26#include "name_translation.h"
27#include "unittype.h"
28
29struct base_type;
30struct strvec; /* Actually defined in "utility/string_vector.h". */
31struct rgbcolor;
32
33/* Used in the network protocol. */
34 enum special_river_move {
35 RMV_NORMAL = 0,
36 RMV_FAST_STRICT = 1,
37 RMV_FAST_RELAXED = 2,
38 RMV_FAST_ALWAYS = 3,
39};
40
41/* === */
42
43 struct resource_type {
44
45 char id_old_save; /* Single-character identifier used in old savegames. */
46#define RESOURCE_NULL_IDENTIFIER '\0'
47#define RESOURCE_NONE_IDENTIFIER ' '
48
49 int output[O_LAST]; /* Amount added by this resource. */
50
51 struct extra_type *self;
52};
53
54/* === */
55
56#define T_NONE (NULL) /* A special flag meaning no terrain type. */
57#define T_UNKNOWN (NULL) /* An unknown terrain. */
58
59/* The first terrain value. */
60#define T_FIRST 0
61
62/* A hard limit on the number of terrains; useful for static arrays.
63 * Used in the network protocol. */
64#define MAX_NUM_TERRAINS (96)
65
66/* Used in the network protocol. */
67#define SPECENUM_NAME terrain_class
68#define SPECENUM_VALUE0 TC_LAND
69/* TRANS: terrain class: used adjectivally */
70#define SPECENUM_VALUE0NAME N_("Land")
71#define SPECENUM_VALUE1 TC_OCEAN
72/* TRANS: terrain class: used adjectivally */
73#define SPECENUM_VALUE1NAME N_("Oceanic")
74#define SPECENUM_COUNT TC_COUNT
75#include "specenum_gen.h"
76
77/* Types of alterations available to terrain.
78 * This enum is only used in the effects system; the relevant information
79 * is encoded in other members of the terrain structure.
80 *
81 * Used in the network protocol. */
82#define SPECENUM_NAME terrain_alteration
83/* Can build irrigation without changing terrain */
84#define SPECENUM_VALUE0 TA_CAN_IRRIGATE
85/* TRANS: this and following strings may rarely be presented to the player
86 * in ruleset help text, to denote the set of terrains which can be altered
87 * in a particular way */
88#define SPECENUM_VALUE0NAME N_("CanIrrigate")
89/* Can build mine without changing terrain */
90#define SPECENUM_VALUE1 TA_CAN_MINE
91#define SPECENUM_VALUE1NAME N_("CanMine")
92/* Can build roads and/or railroads */
93#define SPECENUM_VALUE2 TA_CAN_ROAD
94#define SPECENUM_VALUE2NAME N_("CanRoad")
95/* Can build military base */
96#define SPECENUM_VALUE3 TA_CAN_BASE
97#define SPECENUM_VALUE3NAME N_("CanBase")
98/* Can place extras with infrapoints */
99#define SPECENUM_VALUE4 TA_CAN_PLACE
100#define SPECENUM_VALUE4NAME N_("CanPlace")
101#define SPECENUM_COUNT TA_COUNT
102#include "specenum_gen.h"
103
104/* Used in the network protocol. */
105#define SPECENUM_NAME terrain_flag_id
106/* No barbarians summoned on this terrain. */
107#define SPECENUM_VALUE0 TER_NO_BARBS
108/* TRANS: this and following strings are 'terrain flags', which may rarely
109 * be presented to the player in ruleset help text */
110#define SPECENUM_VALUE0NAME N_("NoBarbs")
111/* No cities on this terrain. */
112#define SPECENUM_VALUE1 TER_NO_CITIES
113#define SPECENUM_VALUE1NAME N_("NoCities")
114/* Players will start on this terrain type. */
115#define SPECENUM_VALUE2 TER_STARTER
116#define SPECENUM_VALUE2NAME N_("Starter")
117/* Terrains with this type can have road with "River" flag on them. */
118#define SPECENUM_VALUE3 TER_CAN_HAVE_RIVER
119#define SPECENUM_VALUE3NAME N_("CanHaveRiver")
120/*this tile is not safe as coast, (all ocean / ice) */
121#define SPECENUM_VALUE4 TER_UNSAFE_COAST
122#define SPECENUM_VALUE4NAME N_("UnsafeCoast")
123/* Fresh water terrain */
124#define SPECENUM_VALUE5 TER_FRESHWATER
125#define SPECENUM_VALUE5NAME N_("FreshWater")
126/* Map generator does not place this terrain */
127#define SPECENUM_VALUE6 TER_NOT_GENERATED
128#define SPECENUM_VALUE6NAME N_("NotGenerated")
129/* Units on this terrain are not generating or subject to zoc */
130#define SPECENUM_VALUE7 TER_NO_ZOC
131#define SPECENUM_VALUE7NAME N_("NoZoc")
132/* Borders on this terrain are not blocking unit movement */
133#define SPECENUM_VALUE8 TER_ENTER_BORDERS
134#define SPECENUM_VALUE8NAME N_("EnterBorders")
135/* Ice-covered terrain (affects minimap) */
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
150#include "specenum_gen.h"
151
152#define MAX_NUM_USER_TER_FLAGS (TER_USER_LAST - TER_USER_1 + 1)
153
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
176#include "specenum_gen.h"
177
178/*
179 * This struct gives data about each terrain type. There are many ways
180 * it could be extended.
181 */
182 struct terrain {
183 int item_number;
184 struct name_translation name;
185 bool ruledit_disabled; /* Does not really exist - hole in terrain array */
186 void *ruledit_dlg;
187 char graphic_str[MAX_LEN_NAME];
188 char graphic_alt[MAX_LEN_NAME];
189 char graphic_alt2[MAX_LEN_NAME];
190
191 char identifier; /* Single-character identifier used in games saved. */
192 char identifier_load; /* Single-character identifier that was used in the savegame
193 * loaded. */
194
195#define TERRAIN_UNKNOWN_IDENTIFIER 'u'
196
197 enum terrain_class tclass;
198
199 int movement_cost; /* whole MP, not scaled by SINGLE_MOVE */
200 int defense_bonus; /* % defense bonus - defaults to zero */
201
202 int output[O_LAST];
203
204 struct extra_type **resources; /* NULL-terminated */
205 int *resource_freq; /* same length as resources */
206
207#define RESOURCE_FREQUENCY_MINIMUM (0)
208#define RESOURCE_FREQUENCY_DEFAULT (1)
209#define RESOURCE_FREQUENCY_MAXIMUM (255)
210
211 int road_output_incr_pct[O_LAST];
212 int base_time;
213 int road_time;
214
215 struct terrain *cultivate_result;
216 int cultivate_time;
217
218 struct terrain *plant_result;
219 int plant_time;
220
221 int irrigation_food_incr;
222 int irrigation_time;
223
224 int mining_shield_incr;
225 int mining_time;
226
227 int placing_time;
228
229 struct terrain *transform_result;
230
231 int transform_time;
232 int pillage_time;
233
234 /* Currently only clean times, but named for future */
235 int extra_removal_times[MAX_EXTRA_TYPES];
236
237 const struct unit_type *animal;
238
239 /* May be NULL if the transformation is impossible. */
240 struct terrain *warmer_wetter_result, *warmer_drier_result;
241 struct terrain *cooler_wetter_result, *cooler_drier_result;
242
243 /* These are special properties of the terrain used by mapgen. If a tile
244 * has a property, then the value gives the weighted amount of tiles that
245 * will be assigned this terrain.
246 *
247 * For instance if mountains have 70 and hills have 30 of MG_MOUNTAINOUS
248 * then 70% of 'mountainous' tiles will be given mountains.
249 *
250 * Ocean_depth is different. Instead of a percentage, the depth of the
251 * tile in the range 0 (never chosen) to 100 (deepest) is used.
252 */
253 int property[MG_COUNT];
254#define TERRAIN_OCEAN_DEPTH_MINIMUM (1)
255#define TERRAIN_OCEAN_DEPTH_MAXIMUM (100)
256
257 bv_unit_classes native_to;
258
259 bv_terrain_flags flags;
260
261 struct rgbcolor *rgb;
262
263 struct strvec *helptext;
264};
265
266/* General terrain accessor functions. */
267 Terrain_type_id terrain_count(void);
268 Terrain_type_id terrain_index(const struct terrain *pterrain);
269 Terrain_type_id terrain_number(const struct terrain *pterrain);
270
271struct terrain *terrain_by_number(const Terrain_type_id type);
272
273struct terrain *terrain_by_identifier(const char identifier);
274struct terrain *terrain_by_rule_name(const char *name);
275struct terrain *terrain_by_translated_name(const char *name);
276struct terrain *rand_terrain_by_flag(enum terrain_flag_id flag);
277
278char terrain_identifier(const struct terrain *pterrain);
279const char *terrain_rule_name(const struct terrain *pterrain);
280const char *terrain_name_translation(const struct terrain *pterrain);
281
282/* Functions to operate on a terrain flag. */
283#define terrain_has_flag(terr, flag) BV_ISSET((terr)->flags, flag)
284
285bool is_terrain_flag_card_near(const struct civ_map *nmap,
286 const struct tile *ptile,
287 enum terrain_flag_id flag);
288bool is_terrain_flag_near_tile(const struct civ_map *nmap,
289 const struct tile *ptile,
290 enum terrain_flag_id flag);
291int count_terrain_flag_near_tile(const struct civ_map *nmap,
292 const struct tile *ptile,
293 bool cardinal_only, bool percentage,
294 enum terrain_flag_id flag);
295void user_terrain_flags_init(void);
296void user_terrain_flags_free(void);
297void set_user_terrain_flag_name(enum terrain_flag_id id, const char *name, const char *helptxt);
298const char *terrain_flag_helptxt(enum terrain_flag_id id);
299
300/* Terrain-specific functions. */
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))
305
306bool terrain_has_resource(const struct terrain *pterrain,
307 const struct extra_type *presource);
308
309/* Functions to operate on a general terrain type. */
310bool is_terrain_card_near(const struct civ_map *nmap,
311 const struct tile *ptile,
312 const struct terrain *pterrain,
313 bool check_self);
314bool is_terrain_near_tile(const struct civ_map *nmap,
315 const struct tile *ptile,
316 const struct terrain *pterrain,
317 bool check_self);
318int count_terrain_property_near_tile(const struct civ_map *nmap,
319 const struct tile *ptile,
320 bool cardinal_only, bool percentage,
321 enum mapgen_terrain_property prop);
322
323bool is_resource_card_near(const struct civ_map *nmap,
324 const struct tile *ptile,
325 const struct extra_type *pres,
326 bool check_self);
327bool is_resource_near_tile(const struct civ_map *nmap,
328 const struct tile *ptile,
329 const struct extra_type *pres,
330 bool check_self);
331
332struct resource_type *resource_type_init(struct extra_type *pextra);
333void resource_types_free(void);
334
335struct extra_type *resource_extra_get(const struct resource_type *presource);
336
337/* Special helper functions */
338const char *get_infrastructure_text(bv_extras extras);
339struct extra_type *get_preferred_pillage(bv_extras extras);
340
341int terrain_extra_build_time(const struct terrain *pterrain,
342 enum unit_activity activity,
343 const struct extra_type *tgt);
344 int terrain_extra_removal_time(const struct terrain *pterrain,
345 enum unit_activity activity,
346 const struct extra_type *tgt)
347 fc__attribute((nonnull (1, 3)));
348
349/* Functions to operate on a terrain class. */
350const char *terrain_class_name_translation(enum terrain_class tclass);
351
352enum terrain_class terrain_type_terrain_class(const struct terrain *pterrain);
353bool is_terrain_class_card_near(const struct civ_map *nmap,
354 const struct tile *ptile, enum terrain_class tclass);
355bool is_terrain_class_near_tile(const struct civ_map *nmap,
356 const struct tile *ptile, enum terrain_class tclass);
357int count_terrain_class_near_tile(const struct civ_map *nmap,
358 const struct tile *ptile,
359 bool cardinal_only, bool percentage,
360 enum terrain_class tclass);
361
362/* Functions to deal with possible terrain alterations. */
363bool terrain_can_support_alteration(const struct terrain *pterrain,
364 enum terrain_alteration talter);
365
366/* Initialization and iteration */
367void terrains_init(void);
368void terrains_free(void);
369
370struct terrain *terrain_array_first(void);
371const struct terrain *terrain_array_last(void);
372
373#define terrain_type_iterate(_p) \
374{ \
375 struct terrain *_p = terrain_array_first(); \
376 if (NULL != _p) { \
377 for (; _p <= terrain_array_last(); _p++) {
378
379#define terrain_type_iterate_end \
380 } \
381 } \
382}
383
384#define terrain_re_active_iterate(_p) \
385 terrain_type_iterate(_p) { \
386 if (!_p->ruledit_disabled) {
387
388#define terrain_re_active_iterate_end \
389 } \
390 } terrain_type_iterate_end;
391
392#define terrain_resources_iterate(pterrain, _res, _freq) \
393 if (NULL != pterrain && NULL != pterrain->resources) { \
394 int _res##_index; \
395 for (_res##_index = 0; \
396 pterrain->resources[_res##_index] != NULL; \
397 _res##_index++) { \
398 struct extra_type *_res = pterrain->resources[_res##_index]; \
399 int _freq = pterrain->resource_freq[_res##_index];
400
401#define terrain_resources_iterate_end \
402 } \
403 }
404
405#ifdef __cplusplus
406}
407#endif /* __cplusplus */
408
409#endif /* FC__TERRAIN_H */
bitvector.h
incite_cost
char * incite_cost
Definition comments.c:74
extras
static struct extra_type extras[MAX_EXTRA_TYPES]
Definition extras.c:31
fc_types.h
Terrain_type_id
int Terrain_type_id
Definition fc_types.h:376
MAX_EXTRA_TYPES
#define MAX_EXTRA_TYPES
Definition fc_types.h:50
MAX_LEN_NAME
#define MAX_LEN_NAME
Definition fc_types.h:66
O_LAST
@ O_LAST
Definition fc_types.h:101
type
GType type
Definition repodlgs.c:1313
name
const char * name
Definition inputfile.c:127
name_translation.h
shared.h
specenum_gen.h
base_type
Definition base.h:41
civ_map
Definition map_types.h:71
extra_type
Definition extras.h:88
name_translation
Definition name_translation.h:35
resource_type
Definition terrain.h:43
resource_type::self
struct extra_type * self
Definition terrain.h:51
resource_type::id_old_save
char id_old_save
Definition terrain.h:45
resource_type::output
int output[O_LAST]
Definition terrain.h:49
rgbcolor
Definition rgbcolor.h:33
strvec
Definition string_vector.c:29
terrain
Definition terrain.h:182
terrain::cultivate_result
struct terrain * cultivate_result
Definition terrain.h:215
terrain::placing_time
int placing_time
Definition terrain.h:227
terrain::cooler_wetter_result
struct terrain * cooler_wetter_result
Definition terrain.h:241
terrain::resources
struct extra_type ** resources
Definition terrain.h:204
terrain::cooler_drier_result
struct terrain * cooler_drier_result
Definition terrain.h:241
terrain::item_number
int item_number
Definition terrain.h:183
terrain::helptext
struct strvec * helptext
Definition terrain.h:263
terrain::warmer_wetter_result
struct terrain * warmer_wetter_result
Definition terrain.h:240
terrain::graphic_alt2
char graphic_alt2[MAX_LEN_NAME]
Definition terrain.h:189
terrain::flags
bv_terrain_flags flags
Definition terrain.h:259
terrain::resource_freq
int * resource_freq
Definition terrain.h:205
terrain::native_to
bv_unit_classes native_to
Definition terrain.h:257
terrain::road_time
int road_time
Definition terrain.h:213
terrain::name
struct name_translation name
Definition terrain.h:184
terrain::plant_time
int plant_time
Definition terrain.h:219
terrain::plant_result
struct terrain * plant_result
Definition terrain.h:218
terrain::irrigation_food_incr
int irrigation_food_incr
Definition terrain.h:221
terrain::warmer_drier_result
struct terrain * warmer_drier_result
Definition terrain.h:240
terrain::defense_bonus
int defense_bonus
Definition terrain.h:200
terrain::cultivate_time
int cultivate_time
Definition terrain.h:216
terrain::movement_cost
int movement_cost
Definition terrain.h:199
terrain::animal
const struct unit_type * animal
Definition terrain.h:237
terrain::pillage_time
int pillage_time
Definition terrain.h:232
terrain::output
int output[O_LAST]
Definition terrain.h:202
terrain::transform_time
int transform_time
Definition terrain.h:231
terrain::graphic_alt
char graphic_alt[MAX_LEN_NAME]
Definition terrain.h:188
terrain::mining_time
int mining_time
Definition terrain.h:225
terrain::identifier_load
char identifier_load
Definition terrain.h:192
terrain::rgb
struct rgbcolor * rgb
Definition terrain.h:261
terrain::graphic_str
char graphic_str[MAX_LEN_NAME]
Definition terrain.h:187
terrain::tclass
enum terrain_class tclass
Definition terrain.h:197
terrain::road_output_incr_pct
int road_output_incr_pct[O_LAST]
Definition terrain.h:211
terrain::extra_removal_times
int extra_removal_times[MAX_EXTRA_TYPES]
Definition terrain.h:235
terrain::transform_result
struct terrain * transform_result
Definition terrain.h:229
terrain::irrigation_time
int irrigation_time
Definition terrain.h:222
terrain::base_time
int base_time
Definition terrain.h:212
terrain::mining_shield_incr
int mining_shield_incr
Definition terrain.h:224
terrain::ruledit_dlg
void * ruledit_dlg
Definition terrain.h:186
terrain::identifier
char identifier
Definition terrain.h:191
terrain::ruledit_disabled
bool ruledit_disabled
Definition terrain.h:185
tile
Definition tile.h:50
unit_type
Definition unittype.h:500
fc__attribute
#define fc__attribute(x)
Definition support.h:99
user_terrain_flags_init
void user_terrain_flags_init(void)
Definition terrain.c:764
terrains_free
void terrains_free(void)
Definition terrain.c:65
terrain_by_rule_name
struct terrain * terrain_by_rule_name(const char *name)
Definition terrain.c:186
is_terrain_class_near_tile
bool is_terrain_class_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum terrain_class tclass)
Definition terrain.c:612
terrain_identifier
char terrain_identifier(const struct terrain *pterrain)
Definition terrain.c:126
terrain_count
Terrain_type_id terrain_count(void)
Definition terrain.c:118
terrains_init
void terrains_init(void)
Definition terrain.c:42
resource_extra_get
struct extra_type * resource_extra_get(const struct resource_type *presource)
Definition terrain.c:296
terrain_can_support_alteration
bool terrain_can_support_alteration(const struct terrain *pterrain, enum terrain_alteration talter)
Definition terrain.c:673
count_terrain_class_near_tile
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:633
is_terrain_class_card_near
bool is_terrain_class_card_near(const struct civ_map *nmap, const struct tile *ptile, enum terrain_class tclass)
Definition terrain.c:591
terrain_by_translated_name
struct terrain * terrain_by_translated_name(const char *name)
Definition terrain.c:202
count_terrain_flag_near_tile
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:478
terrain_class_name_translation
int const char * terrain_class_name_translation(enum terrain_class tclass)
Definition terrain.c:661
get_infrastructure_text
const char * get_infrastructure_text(bv_extras extras)
Definition terrain.c:508
terrain_index
Terrain_type_id terrain_index(const struct terrain *pterrain)
Definition terrain.c:138
is_resource_card_near
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:395
terrain_name_translation
const char * terrain_name_translation(const struct terrain *pterrain)
Definition terrain.c:238
terrain_array_first
struct terrain * terrain_array_first(void)
Definition terrain.c:96
rand_terrain_by_flag
struct terrain * rand_terrain_by_flag(enum terrain_flag_id flag)
Definition terrain.c:217
terrain_by_number
struct terrain * terrain_by_number(const Terrain_type_id type)
Definition terrain.c:156
is_terrain_card_near
bool is_terrain_card_near(const struct civ_map *nmap, const struct tile *ptile, const struct terrain *pterrain, bool check_self)
Definition terrain.c:327
terrain_rule_name
const char * terrain_rule_name(const struct terrain *pterrain)
Definition terrain.c:247
is_resource_near_tile
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:416
resource_types_free
void resource_types_free(void)
Definition terrain.c:288
user_terrain_flags_free
void user_terrain_flags_free(void)
Definition terrain.c:776
terrain_type_terrain_class
enum terrain_class terrain_type_terrain_class(const struct terrain *pterrain)
Definition terrain.c:582
terrain_flag_helptxt
const char * terrain_flag_helptxt(enum terrain_flag_id id)
Definition terrain.c:829
terrain_has_resource
bool terrain_has_resource(const struct terrain *pterrain, const struct extra_type *presource)
Definition terrain.c:255
resource_type_init
struct resource_type * resource_type_init(struct extra_type *pextra)
Definition terrain.c:272
is_terrain_flag_near_tile
bool is_terrain_flag_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum terrain_flag_id flag)
Definition terrain.c:458
get_preferred_pillage
struct extra_type * get_preferred_pillage(bv_extras extras)
Definition terrain.c:550
set_user_terrain_flag_name
void set_user_terrain_flag_name(enum terrain_flag_id id, const char *name, const char *helptxt)
Definition terrain.c:788
terrain_array_last
const struct terrain * terrain_array_last(void)
Definition terrain.c:107
terrain_extra_build_time
int terrain_extra_build_time(const struct terrain *pterrain, enum unit_activity activity, const struct extra_type *tgt)
Definition terrain.c:699
terrain_number
Terrain_type_id terrain_number(const struct terrain *pterrain)
Definition terrain.c:147
terrain_by_identifier
struct terrain * terrain_by_identifier(const char identifier)
Definition terrain.c:169
is_terrain_flag_card_near
bool is_terrain_flag_card_near(const struct civ_map *nmap, const struct tile *ptile, enum terrain_flag_id flag)
Definition terrain.c:438
terrain_extra_removal_time
int terrain_extra_removal_time(const struct terrain *pterrain, enum unit_activity activity, const struct extra_type *tgt) fc__attribute((nonnull(1
special_river_move
special_river_move
Definition terrain.h:34
RMV_NORMAL
@ RMV_NORMAL
Definition terrain.h:35
RMV_FAST_RELAXED
@ RMV_FAST_RELAXED
Definition terrain.h:37
RMV_FAST_STRICT
@ RMV_FAST_STRICT
Definition terrain.h:36
RMV_FAST_ALWAYS
@ RMV_FAST_ALWAYS
Definition terrain.h:38
count_terrain_property_near_tile
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:369
is_terrain_near_tile
bool is_terrain_near_tile(const struct civ_map *nmap, const struct tile *ptile, const struct terrain *pterrain, bool check_self)
Definition terrain.c:348
unittype.h