Freeciv-3.2
Loading...
Searching...
No Matches
Functions | Variables
improvement.c File Reference
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "shared.h"
#include "string_vector.h"
#include "support.h"
#include "game.h"
#include "map.h"
#include "tech.h"
#include "victory.h"
#include "improvement.h"

Go to the source code of this file.

Functions

void improvements_init (void)
 
static void improvement_free (struct impr_type *p)
 
void improvements_free (void)
 
void improvement_feature_cache_init (void)
 
struct impr_typeimprovement_array_first (void)
 
const struct impr_typeimprovement_array_last (void)
 
Impr_type_id improvement_count (void)
 
Impr_type_id improvement_index (const struct impr_type *pimprove)
 
Impr_type_id improvement_number (const struct impr_type *pimprove)
 
struct impr_typeimprovement_by_number (const Impr_type_id id)
 
const struct impr_typevalid_improvement (const struct impr_type *pimprove)
 
const struct impr_typevalid_improvement_by_number (const Impr_type_id id)
 
const charimprovement_name_translation (const struct impr_type *pimprove)
 
const charimprovement_rule_name (const struct impr_type *pimprove)
 
int impr_base_build_shield_cost (const struct impr_type *pimprove)
 
int impr_estimate_build_shield_cost (const struct player *pplayer, const struct tile *ptile, const struct impr_type *pimprove)
 
int impr_build_shield_cost (const struct city *pcity, 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_sell_gold (const struct impr_type *pimprove)
 
bool is_wonder (const struct impr_type *pimprove)
 
struct impr_typeimprovement_by_translated_name (const char *name)
 
struct impr_typeimprovement_by_rule_name (const char *name)
 
bool improvement_has_flag (const struct impr_type *pimprove, enum impr_flag_id flag)
 
bool is_improvement_visible (const struct impr_type *pimprove)
 
bool can_improvement_go_obsolete (const struct impr_type *pimprove)
 
bool improvement_obsolete (const struct player *pplayer, const struct impr_type *pimprove, const struct city *pcity)
 
static bool impr_provides_buildable_units (const struct city *pcity, const struct impr_type *pimprove)
 
static bool impr_provides_buildable_extras (const struct city *pcity, const struct impr_type *pimprove)
 
static bool impr_prevents_disaster (const struct city *pcity, const struct impr_type *pimprove)
 
static bool impr_protects_vs_actions (const struct city *pcity, const struct impr_type *pimprove)
 
static bool impr_allows_actions (const struct city *pcity, const struct impr_type *pimprove)
 
static bool improvement_has_side_effects (const struct city *pcity, const struct impr_type *pimprove)
 
static bool improvement_has_effects (const struct city *pcity, const struct impr_type *pimprove)
 
bool is_improvement_productive (const struct city *pcity, const struct impr_type *pimprove)
 
bool is_improvement_redundant (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 can_player_build_improvement_now (const struct player *p, struct impr_type *pimprove)
 
bool can_player_build_improvement_later (const struct player *p, const struct impr_type *pimprove)
 
bool is_great_wonder (const struct impr_type *pimprove)
 
bool is_small_wonder (const struct impr_type *pimprove)
 
bool is_improvement (const struct impr_type *pimprove)
 
bool is_special_improvement (const struct impr_type *pimprove)
 
bool is_convert_improvement (const struct impr_type *pimprove)
 
void wonder_built (const struct city *pcity, const struct impr_type *pimprove)
 
void wonder_destroyed (const struct city *pcity, const struct impr_type *pimprove)
 
bool wonder_is_lost (const struct player *pplayer, const struct impr_type *pimprove)
 
bool wonder_is_built (const struct player *pplayer, const struct impr_type *pimprove)
 
struct citycity_from_wonder (const struct player *pplayer, const struct impr_type *pimprove)
 
bool wonder_visible_to_player (const struct impr_type *wonder, const struct player *pplayer, const struct player *owner, enum fc_tristate embassy)
 
bool great_wonder_is_built (const struct impr_type *pimprove)
 
bool great_wonder_is_destroyed (const struct impr_type *pimprove)
 
bool great_wonder_is_available (const struct impr_type *pimprove)
 
struct citycity_from_great_wonder (const struct impr_type *pimprove)
 
struct playergreat_wonder_owner (const struct impr_type *pimprove)
 
bool small_wonder_is_built (const struct player *pplayer, const struct impr_type *pimprove)
 
struct citycity_from_small_wonder (const struct player *pplayer, const struct impr_type *pimprove)
 
bool can_sell_building (const struct impr_type *pimprove)
 
bool can_city_sell_building (const struct city *pcity, const struct impr_type *pimprove)
 
bool is_building_sellable (const struct impr_type *pimprove)
 
enum test_result test_player_sell_building_now (struct player *pplayer, struct city *pcity, const struct impr_type *pimprove)
 
const struct impr_typeimprovement_replacement (const struct impr_type *pimprove)
 
void user_impr_flags_init (void)
 
void impr_flags_free (void)
 
void set_user_impr_flag_name (enum impr_flag_id id, const char *name, const char *helptxt)
 
const charimpr_flag_id_name_cb (enum impr_flag_id flag)
 
const charimpr_flag_helptxt (enum impr_flag_id id)
 

Variables

static struct impr_type improvement_types [B_LAST]
 
static struct user_flag user_impr_flags [MAX_NUM_USER_BUILDING_FLAGS]
 

Function Documentation

◆ can_city_sell_building()

bool can_city_sell_building ( const struct city pcity,
const struct impr_type pimprove 
)

◆ can_improvement_go_obsolete()

bool can_improvement_go_obsolete ( const struct impr_type pimprove)

Return TRUE if the improvement can ever go obsolete. Can be used for buildings or wonders.

Definition at line 403 of file improvement.c.

Referenced by dai_can_requirement_be_met_in_city(), is_req_preventing(), is_req_unchanging(), and req_text_insert().

◆ can_player_build_improvement_direct()

bool can_player_build_improvement_direct ( const struct player p,
const struct impr_type pimprove 
)

Whether player can build given building somewhere, ignoring whether it is obsolete.

Definition at line 668 of file improvement.c.

Referenced by api_methods_player_can_build_impr_direct(), can_city_build_improvement_direct(), can_player_build_improvement_now(), can_player_build_unit_direct(), dai_wants_defender_against(), and dai_wants_role_unit().

◆ can_player_build_improvement_later()

bool can_player_build_improvement_later ( const struct player p,
const struct impr_type pimprove 
)

Whether player can eventually build given building somewhere – i.e., returns TRUE if building is available with current tech OR will be available with future tech. Returns FALSE if building is obsolete.

Definition at line 743 of file improvement.c.

Referenced by ba_human_wants(), can_city_build_improvement_later(), collect_eventually_buildable_targets(), dai_build_adv_adjust(), and popup_worklist_editor().

◆ can_player_build_improvement_now()

bool can_player_build_improvement_now ( const struct player p,
struct impr_type pimprove 
)

Whether player can build given building somewhere immediately. Returns FALSE if building is obsolete.

Definition at line 726 of file improvement.c.

Referenced by collect_buildable_targets(), collect_eventually_buildable_targets(), and popup_worklist_editor().

◆ can_sell_building()

bool can_sell_building ( const struct impr_type pimprove)

Return TRUE iff the improvement can be sold.

Definition at line 1095 of file improvement.c.

Referenced by economy_report_command_callback(), economy_report_selection_callback(), and eco_report::selection_changed().

◆ city_from_great_wonder()

struct city * city_from_great_wonder ( const struct impr_type pimprove)

Get the world city with this great wonder. This doesn't always success on the client side.

Definition at line 1020 of file improvement.c.

Referenced by build_or_move_building(), calc_civ_score(), found_new_tech(), is_req_knowable(), and report_wonders_of_the_world().

◆ city_from_small_wonder()

struct city * city_from_small_wonder ( const struct player pplayer,
const struct impr_type pimprove 
)

Get the player city with this small wonder.

Definition at line 1080 of file improvement.c.

Referenced by base_want(), build_free_small_wonders(), and build_or_move_building().

◆ city_from_wonder()

struct city * city_from_wonder ( const struct player pplayer,
const struct impr_type pimprove 
)

Get the world city with this wonder (small or great). This doesn't always succeed on the client side, and even when it does, it may return an "invisible" city whose members are unexpectedly NULL; take care.

Definition at line 895 of file improvement.c.

Referenced by can_player_build_unit_direct(), city_from_great_wonder(), city_from_small_wonder(), plr_widget::nation_selected(), num_continent_buildings(), update_intel_dialog(), and update_intel_wonder_dialog().

◆ great_wonder_is_available()

bool great_wonder_is_available ( const struct impr_type pimprove)

◆ great_wonder_is_built()

bool great_wonder_is_built ( const struct impr_type pimprove)

Returns whether this wonder is currently built.

Definition at line 986 of file improvement.c.

Referenced by can_player_build_unit_direct(), get_city_dialog_production_row(), num_world_buildings(), num_world_buildings_total(), and popup_worklist_editor().

◆ great_wonder_is_destroyed()

bool great_wonder_is_destroyed ( const struct impr_type pimprove)

◆ great_wonder_owner()

struct player * great_wonder_owner ( const struct impr_type pimprove)

Get the player owning this small wonder. This doesn't always success on the client side.

Definition at line 1052 of file improvement.c.

Referenced by can_player_build_unit_direct().

◆ impr_allows_actions()

static bool impr_allows_actions ( const struct city pcity,
const struct impr_type pimprove 
)
static

Returns TRUE iff improvement allows its owner to perform an action.

Definition at line 530 of file improvement.c.

Referenced by improvement_has_side_effects().

◆ impr_base_build_shield_cost()

int impr_base_build_shield_cost ( const struct impr_type pimprove)

Returns the base number of shields it takes to build this improvement. This one does not take city specific bonuses in to account.

Definition at line 261 of file improvement.c.

Referenced by help_update_improvement(), help_update_wonder(), popup_impr_info(), and help_widget::set_topic_building().

◆ impr_build_shield_cost()

int impr_build_shield_cost ( const struct city pcity,
const struct impr_type pimprove 
)

◆ impr_buy_gold_cost()

int impr_buy_gold_cost ( const struct city pcity,
const struct impr_type pimprove,
int  shields_in_stock 
)

Returns the amount of gold it takes to rush this improvement.

Definition at line 306 of file improvement.c.

Referenced by city_production_buy_gold_cost(), military_advisor_choose_build(), and wonder_benefit().

◆ impr_estimate_build_shield_cost()

int impr_estimate_build_shield_cost ( const struct player pplayer,
const struct tile ptile,
const struct impr_type pimprove 
)

Returns estimate of the number of shields it takes to build this improvement. pplayer and ptile can be NULL, but that might reduce quality of the estimate.

Definition at line 273 of file improvement.c.

Referenced by get_city_dialog_production_row(), and get_tooltip_improvement().

◆ impr_flag_helptxt()

const char * impr_flag_helptxt ( enum impr_flag_id  id)

Return the (untranslated) help text of the user building flag.

Definition at line 1229 of file improvement.c.

Referenced by save_buildings_ruleset(), and send_ruleset_buildings().

◆ impr_flag_id_name_cb()

const char * impr_flag_id_name_cb ( enum impr_flag_id  flag)

Building flag name callback, called from specenum code.

Definition at line 1217 of file improvement.c.

Referenced by save_buildings_ruleset().

◆ impr_flags_free()

void impr_flags_free ( void  )

Frees the memory associated with all building flags

Definition at line 1176 of file improvement.c.

Referenced by game_ruleset_free().

◆ impr_prevents_disaster()

static bool impr_prevents_disaster ( const struct city pcity,
const struct impr_type pimprove 
)
static

Returns TRUE iff improvement prevents a disaster in city

Definition at line 484 of file improvement.c.

Referenced by improvement_has_side_effects().

◆ impr_protects_vs_actions()

static bool impr_protects_vs_actions ( const struct city pcity,
const struct impr_type pimprove 
)
static

Returns TRUE iff improvement protects against an action on the city FIXME: This is prone to false positives: for example, if one requires a special tech or unit to perform an action, and no other player has or can gain that tech or unit, protection is still claimed.

Definition at line 508 of file improvement.c.

Referenced by improvement_has_side_effects().

◆ impr_provides_buildable_extras()

static bool impr_provides_buildable_extras ( const struct city pcity,
const struct impr_type pimprove 
)
static

Returns TRUE iff improvement provides extras buildable in city

Definition at line 457 of file improvement.c.

Referenced by improvement_has_side_effects().

◆ impr_provides_buildable_units()

static bool impr_provides_buildable_units ( const struct city pcity,
const struct impr_type pimprove 
)
static

Returns TRUE iff improvement provides units buildable in city

Definition at line 434 of file improvement.c.

Referenced by improvement_has_side_effects().

◆ impr_sell_gold()

int impr_sell_gold ( const struct impr_type pimprove)

◆ improvement_array_first()

struct impr_type * improvement_array_first ( void  )

Return the first item of improvements.

Definition at line 142 of file improvement.c.

◆ improvement_array_last()

const struct impr_type * improvement_array_last ( void  )

Return the last item of improvements.

Definition at line 153 of file improvement.c.

◆ improvement_by_number()

struct impr_type * improvement_by_number ( const Impr_type_id  id)

◆ improvement_by_rule_name()

struct impr_type * improvement_by_rule_name ( const char name)

◆ improvement_by_translated_name()

struct impr_type * improvement_by_translated_name ( const char name)

Does a linear search of improvement_types[].name.translated Returns NULL when none match.

Definition at line 352 of file improvement.c.

Referenced by help_update_improvement(), help_update_wonder(), help_dialog::make_tree(), and help_widget::set_topic_building().

◆ improvement_count()

Impr_type_id improvement_count ( void  )

◆ improvement_feature_cache_init()

void improvement_feature_cache_init ( void  )

Cache features of the improvement

Definition at line 92 of file improvement.c.

Referenced by handle_rulesets_ready(), and load_rulesetdir().

◆ improvement_free()

static void improvement_free ( struct impr_type p)
static

Frees the memory associated with this improvement.

Definition at line 68 of file improvement.c.

Referenced by improvements_free().

◆ improvement_has_effects()

static bool improvement_has_effects ( const struct city pcity,
const struct impr_type pimprove 
)
static

Returns TRUE iff improvement provides some effect (good or bad).

Definition at line 596 of file improvement.c.

Referenced by is_improvement_productive().

◆ improvement_has_flag()

bool improvement_has_flag ( const struct impr_type pimprove,
enum impr_flag_id  flag 
)

◆ improvement_has_side_effects()

static bool improvement_has_side_effects ( const struct city pcity,
const struct impr_type pimprove 
)
static

Check if an improvement has side effects for a city. Side effects are any benefits that accrue that are not tracked by the effects system.

Note that this function will always return FALSE if the improvement does not currently provide a benefit to the city (for example, if the improvement has not yet been built, or another city benefits from the improvement in this city (i.e. Wonders)).

Definition at line 583 of file improvement.c.

Referenced by is_improvement_productive(), and is_improvement_redundant().

◆ improvement_index()

Impr_type_id improvement_index ( const struct impr_type pimprove)

◆ improvement_name_translation()

const char * improvement_name_translation ( const struct impr_type pimprove)

Return the (translated) name of the given improvement. You don't have to free the return pointer.

Definition at line 243 of file improvement.c.

Referenced by api_methods_building_type_name_translation(), apply_disaster(), boot_help_texts(), build_free_small_wonders(), city_add_improvement_with_gov_notice(), city_build_building(), city_dialog_update_building(), city_global_turn_notify(), city_improvement_name_translation(), city_increase_size(), city_landlocked_sell_coastal_improvements(), city_turn_notify(), cityrep_buy(), client_change_all(), go_act_menu::create(), create_tech_info(), dai_city_sell_noncritical(), diplomat_sabotage(), city_widget::display_list_menu(), do_unit_strike_city_building(), economy_report_command_callback(), economy_report_dialog_popup(), economy_report_update(), extviewer_refresh_widgets(), found_new_tech(), get_prod_complete_string(), get_tooltip_improvement(), handle_edit_city(), help_callback(), help_update_tech(), helptext_building(), helptext_nation(), impr_callback(), improvement_by_translated_name(), insert_allows(), manual_improvements(), research_diagram::mousePressEvent(), plr_widget::nation_selected(), city_production_delegate::paint(), city_production_model::populate(), popup_impr_info(), popup_info_text(), popup_sell_impr_callback(), popup_worklist_editor(), real_city_report_dialog_update_city(), real_info_city_report_dialog_update(), real_menus_init(), real_menus_update(), really_handle_city_buy(), really_handle_city_sell(), redraw_city_dialog(), remove_obsolete_buildings_city(), report_wonders_of_the_world(), report_wonders_of_the_world_long(), req_text_insert(), research_tech_lost(), sanity_check_req_individual(), select_impr_or_unit_callback(), select_impr_or_unit_callback(), sell_all_improvements(), eco_report::sell_buildings(), sell_random_building(), eco_report::sell_redundant(), help_widget::set_topic_tech(), universal_name_translation(), update_intel_dialog(), update_intel_wonder_dialog(), eco_report::update_report(), upgrade_building_prod(), and wl_help_from_iter().

◆ improvement_number()

Impr_type_id improvement_number ( const struct impr_type pimprove)

◆ improvement_obsolete()

bool improvement_obsolete ( const struct player pplayer,
const struct impr_type pimprove,
const struct city pcity 
)

◆ improvement_replacement()

const struct impr_type * improvement_replacement ( const struct impr_type pimprove)

Try to find a sensible replacement building, based on other buildings that may have caused this one to become obsolete.

Definition at line 1150 of file improvement.c.

Referenced by building_upgrades_to().

◆ improvement_rule_name()

const char * improvement_rule_name ( const struct impr_type pimprove)

◆ improvements_free()

void improvements_free ( void  )

Frees the memory associated with all improvements.

Definition at line 82 of file improvement.c.

Referenced by game_ruleset_free().

◆ improvements_init()

void improvements_init ( void  )

Initialize building structures.

Definition at line 48 of file improvement.c.

Referenced by game_ruleset_init().

◆ is_building_sellable()

bool is_building_sellable ( const struct impr_type pimprove)

Return TRUE iff the building is sellable one.

Definition at line 1114 of file improvement.c.

Referenced by can_city_sell_building(), can_sell_building(), city_improvement_upkeep(), and rs_buildings().

◆ is_convert_improvement()

bool is_convert_improvement ( const struct impr_type pimprove)

◆ is_great_wonder()

bool is_great_wonder ( const struct impr_type pimprove)

Is this building a great wonder?

Definition at line 776 of file improvement.c.

Referenced by api_edit_remove_building(), api_methods_building_type_is_great_wonder(), base_want(), boot_help_texts(), build_or_move_building(), calc_civ_score(), can_player_build_improvement_direct(), can_player_build_improvement_later(), can_player_build_unit_direct(), change_build_target(), city_build_building(), city_build_free_buildings(), city_dialog_update_improvement_list(), city_from_great_wonder(), city_global_turn_notify(), city_improvement_name_translation(), city_turns_to_build(), dai_build_adv_adjust(), dai_can_player_build_improvement_later(), dai_war_desire(), found_new_tech(), get_city_dialog_production_row(), great_wonder_is_available(), great_wonder_is_built(), great_wonder_is_destroyed(), great_wonder_owner(), help_callback(), help_type_by_requirement(), help_update_improvement(), help_update_tech(), help_update_wonder(), impr_callback(), initialize_globals(), is_req_knowable(), is_wonder(), manual_improvements(), research_diagram::mousePressEvent(), plr_widget::nation_selected(), nr_wonders(), num_world_buildings(), num_world_buildings_total(), popup_worklist_editor(), propval_as_string(), remove_city(), report_wonders_of_the_world(), report_wonders_of_the_world_long(), req_text_insert(), sanity_check_req_individual(), help_widget::set_topic_building(), help_widget::set_topic_tech(), sg_save_players(), tactical_req_cb(), target_get_section(), transfer_city(), unchanging_building(), update_intel_wonder_dialog(), wl_help_from_iter(), wonder_built(), wonder_destroyed(), and wonder_visible_to_player().

◆ is_improvement()

bool is_improvement ( const struct impr_type pimprove)

◆ is_improvement_productive()

bool is_improvement_productive ( const struct city pcity,
const struct impr_type pimprove 
)

Returns TRUE if an improvement in a city is productive, in some way.

Note that unproductive improvements may become productive later, if appropriate conditions are met (e.g. a special building that isn't producing units under the current government might under another).

Definition at line 624 of file improvement.c.

Referenced by ba_human_wants(), building_advisor(), and building_crucial().

◆ is_improvement_redundant()

bool is_improvement_redundant ( const struct city pcity,
const struct impr_type pimprove 
)

Returns TRUE if an improvement in a city is redundant, that is, the city wouldn't lose anything by losing the improvement, or gain anything by building it. This means:

  • all of its effects (if any) are provided by other means, or it's obsolete (and thus assumed to have no effect); and
  • it's not enabling the city to build some kind of units; and
  • it's not Coinage (IF_GOLD). (Note that it's not impossible that this improvement could become useful if circumstances changed, say if a new government enabled the building of its special units.)

Definition at line 645 of file improvement.c.

Referenced by cell_render_func(), city_dialog_update_building(), city_dialog_update_improvement_list(), city_improvement_name_translation(), dai_city_sell_noncritical(), get_city_dialog_production_row(), get_economy_report_data(), city_production_delegate::paint(), popup_worklist_editor(), and sell_all_improvements().

◆ is_improvement_visible()

bool is_improvement_visible ( const struct impr_type pimprove)

Return TRUE if the improvement should be visible to others without spying

Definition at line 393 of file improvement.c.

Referenced by handle_city_short_info(), is_req_knowable(), popup_info_text(), and update_dumb_city().

◆ is_small_wonder()

bool is_small_wonder ( const struct impr_type pimprove)

◆ is_special_improvement()

bool is_special_improvement ( const struct impr_type pimprove)

Returns TRUE if this is a "special" improvement. For example, spaceship parts and coinage in the default ruleset are considered special.

Definition at line 801 of file improvement.c.

Referenced by api_edit_create_building(), extviewer_refresh_widgets(), handle_edit_city(), and city_production_model::populate().

◆ is_wonder()

bool is_wonder ( const struct impr_type pimprove)

◆ set_user_impr_flag_name()

void set_user_impr_flag_name ( enum impr_flag_id  id,
const char name,
const char helptxt 
)

Sets user defined name for building flag.

Definition at line 1188 of file improvement.c.

Referenced by handle_ruleset_impr_flag(), and load_building_names().

◆ small_wonder_is_built()

bool small_wonder_is_built ( const struct player pplayer,
const struct impr_type pimprove 
)

Returns whether the player has built this small wonder.

Definition at line 1068 of file improvement.c.

Referenced by popup_worklist_editor().

◆ test_player_sell_building_now()

enum test_result test_player_sell_building_now ( struct player pplayer,
struct city pcity,
const struct impr_type pimprove 
)

Return TRUE iff the player can sell the given improvement from city. If pimprove is NULL, returns iff city could sell some building type (this does not check if such building is in this city)

Definition at line 1124 of file improvement.c.

Referenced by impr_item::mouseDoubleClickEvent(), really_handle_city_sell(), and sell_callback().

◆ user_impr_flags_init()

void user_impr_flags_init ( void  )

Initialize user building flags.

Definition at line 1164 of file improvement.c.

Referenced by game_ruleset_init().

◆ valid_improvement()

const struct impr_type * valid_improvement ( const struct impr_type pimprove)

Returns pointer when the improvement_type "exists" in this game, returns NULL otherwise.

An improvement_type doesn't exist for any of:

  • the improvement_type has been flagged as removed by setting its tech_req to A_LAST; [was not in current 2007-07-27]
  • it is a space part, and the spacerace is not enabled.

Definition at line 211 of file improvement.c.

Referenced by advisor_choose_build(), boot_help_texts(), building_upgrades_to(), can_player_build_improvement_direct(), can_player_build_improvement_later(), can_sell_building(), create_tech_info(), research_diagram::create_tooltip_help(), dai_can_player_build_improvement_later(), draw_reqtree(), help_update_tech(), insert_allows(), manual_improvements(), node_rectangle_minimum_size(), help_widget::set_topic_tech(), and valid_improvement_by_number().

◆ valid_improvement_by_number()

const struct impr_type * valid_improvement_by_number ( const Impr_type_id  id)

Returns pointer when the improvement_type "exists" in this game, returns NULL otherwise.

In addition to valid_improvement(), tests for id is out of range.

Definition at line 234 of file improvement.c.

◆ wonder_built()

void wonder_built ( const struct city pcity,
const struct impr_type pimprove 
)

Build a wonder in the city.

Definition at line 823 of file improvement.c.

Referenced by city_add_improvement().

◆ wonder_destroyed()

void wonder_destroyed ( const struct city pcity,
const struct impr_type pimprove 
)

Remove a wonder from a city and destroy it if it's a great wonder. To transfer a great wonder, use great_wonder_transfer.

Definition at line 843 of file improvement.c.

Referenced by city_remove_improvement().

◆ wonder_is_built()

bool wonder_is_built ( const struct player pplayer,
const struct impr_type pimprove 
)

Returns whether the player is currently in possession of this wonder (small or great).

Definition at line 880 of file improvement.c.

Referenced by api_methods_player_has_wonder(), get_city_dialog_production_row(), plr_widget::nation_selected(), num_player_buildings(), player_has_ever_built(), small_wonder_is_built(), update_intel_dialog(), and update_intel_wonder_dialog().

◆ wonder_is_lost()

bool wonder_is_lost ( const struct player pplayer,
const struct impr_type pimprove 
)

Returns whether the player has lost this wonder after having owned it (small or great).

Definition at line 867 of file improvement.c.

Referenced by plr_widget::nation_selected(), player_has_ever_built(), sg_save_player_main(), update_intel_dialog(), and update_intel_wonder_dialog().

◆ wonder_visible_to_player()

bool wonder_visible_to_player ( const struct impr_type wonder,
const struct player pplayer,
const struct player owner,
enum fc_tristate  embassy 
)

Can the player see wonder owned by the other player?

Embassy can be passed as parameter so that caller can make the somewhat costly embassy detection just once even when calling this multiple times (e.g. for number of different wonders)

Definition at line 948 of file improvement.c.

Referenced by package_player_info().

Variable Documentation

◆ improvement_types

struct impr_type improvement_types[B_LAST]
static

◆ user_impr_flags

struct user_flag user_impr_flags[MAX_NUM_USER_BUILDING_FLAGS]
static