13#ifndef FC__IMPROVEMENT_H
14#define FC__IMPROVEMENT_H
42#define B_LAST MAX_NUM_BUILDINGS
47#define SPECENUM_NAME impr_flag_id
49#define SPECENUM_VALUE0 IF_VISIBLE_BY_OTHERS
50#define SPECENUM_VALUE0NAME "VisibleByOthers"
52#define SPECENUM_VALUE1 IF_SAVE_SMALL_WONDER
53#define SPECENUM_VALUE1NAME "SaveSmallWonder"
55#define SPECENUM_VALUE2 IF_GOLD
56#define SPECENUM_VALUE2NAME "Gold"
58#define SPECENUM_VALUE3 IF_DISASTER_PROOF
59#define SPECENUM_VALUE3NAME "DisasterProof"
60#define SPECENUM_COUNT IF_COUNT
61#define SPECENUM_BITVECTOR bv_impr_flags
75 struct requirement_vector
reqs;
113 enum impr_flag_id flag);
120 const struct tile *ptile,
123 int shields_in_stock);
146#define WONDER_DESTROYED (MAX_NUM_PLAYER_SLOTS + 1)
147#define WONDER_NOT_OWNED (MAX_NUM_PLAYER_SLOTS + 2)
148#define WONDER_OWNED(player_id) ((player_id) < MAX_NUM_PLAYER_SLOTS)
151#define WONDER_LOST (-1)
152#define WONDER_NOT_BUILT 0
153#define WONDER_BUILT(city_id) ((city_id) > 0)
166 const struct player *pplayer,
183 const struct city *pcity);
205#define improvement_iterate(_p) \
207 struct impr_type *_p = improvement_array_first(); \
209 for (; _p <= improvement_array_last(); _p++) {
211#define improvement_iterate_end \
216#define improvement_re_active_iterate(_p) \
217 improvement_iterate(_p) { \
218 if (!_p->ruledit_disabled) {
220#define improvement_re_active_iterate_end \
222 } improvement_iterate_end;
224#define genus_iterate(_p) \
226 enum impr_genus_id _p; \
227 for (_p = (enum impr_genus_id)0; _p < IG_COUNT; \
228 _p = (enum impr_genus_id)((int)_p + 1)) {
230#define genus_iterate_end \
#define BV_DEFINE(name, bits)
const struct impr_type * valid_improvement(const struct impr_type *pimprove)
struct impr_type * improvement_by_number(const Impr_type_id id)
bool can_sell_building(const struct impr_type *pimprove)
int impr_sell_gold(const struct impr_type *pimprove)
void improvements_init(void)
const struct impr_type * improvement_array_last(void)
const struct impr_type * valid_improvement_by_number(const Impr_type_id id)
bool can_city_sell_building(const struct city *pcity, const struct impr_type *pimprove)
bool can_player_build_improvement_direct(const struct player *p, const struct impr_type *pimprove)
bool great_wonder_is_built(const struct impr_type *pimprove)
enum test_result test_player_sell_building_now(struct player *pplayer, struct city *pcity, const struct impr_type *pimprove)
bool is_special_improvement(const struct impr_type *pimprove)
bool is_improvement_redundant(const struct city *pcity, const struct impr_type *pimprove)
bool can_player_build_improvement_later(const struct player *p, const struct impr_type *pimprove)
void wonder_built(const struct city *pcity, const struct impr_type *pimprove)
bool great_wonder_is_destroyed(const struct impr_type *pimprove)
bool wonder_is_lost(const struct player *pplayer, const struct impr_type *pimprove)
bool can_player_build_improvement_now(const struct player *p, struct impr_type *pimprove)
bool is_improvement(const struct impr_type *pimprove)
bool wonder_is_built(const struct player *pplayer, const struct impr_type *pimprove)
int impr_base_build_shield_cost(const struct impr_type *pimprove)
Impr_type_id improvement_number(const struct impr_type *pimprove)
bool small_wonder_is_built(const struct player *pplayer, const struct impr_type *pimprove)
bool can_improvement_go_obsolete(const struct impr_type *pimprove)
const char * improvement_rule_name(const struct impr_type *pimprove)
bool is_improvement_visible(const struct impr_type *pimprove)
struct city * city_from_wonder(const struct player *pplayer, const struct impr_type *pimprove)
Impr_type_id improvement_index(const struct impr_type *pimprove)
int impr_buy_gold_cost(const struct city *pcity, const struct impr_type *pimprove, int shields_in_stock)
int impr_build_shield_cost(const struct city *pcity, const struct impr_type *pimprove)
bool is_wonder(const struct impr_type *pimprove)
bool is_great_wonder(const struct impr_type *pimprove)
bool improvement_obsolete(const struct player *pplayer, const struct impr_type *pimprove, const struct city *pcity)
struct impr_type * improvement_by_translated_name(const char *name)
void improvement_feature_cache_init(void)
bool improvement_has_flag(const struct impr_type *pimprove, enum impr_flag_id flag)
struct impr_type * improvement_by_rule_name(const char *name)
struct city * city_from_small_wonder(const struct player *pplayer, const struct impr_type *pimprove)
void wonder_destroyed(const struct city *pcity, const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
struct city * city_from_great_wonder(const struct impr_type *pimprove)
Impr_type_id improvement_count(void)
bool is_small_wonder(const struct impr_type *pimprove)
struct impr_type * improvement_array_first(void)
int impr_estimate_build_shield_cost(const struct player *pplayer, const struct tile *ptile, const struct impr_type *pimprove)
bool wonder_visible_to_player(const struct impr_type *wonder, const struct player *pplayer, const struct player *owner)
const struct impr_type * improvement_replacement(const struct impr_type *pimprove)
struct player * great_wonder_owner(const struct impr_type *pimprove)
bool great_wonder_is_available(const struct impr_type *pimprove)
void improvements_free(void)
bool is_improvement_productive(const struct city *pcity, const struct impr_type *pimprove)
char graphic_str[MAX_LEN_NAME]
char graphic_alt[MAX_LEN_NAME]
struct requirement_vector obsolete_by
char soundtag_alt[MAX_LEN_NAME]
struct requirement_vector reqs
struct name_translation name
char soundtag[MAX_LEN_NAME]