Freeciv-3.2
Loading...
Searching...
No Matches
Functions | Variables
tile.c File Reference
#include "bitvector.h"
#include "log.h"
#include "support.h"
#include "fc_interface.h"
#include "game.h"
#include "map.h"
#include "movement.h"
#include "road.h"
#include "unit.h"
#include "unitlist.h"
#include "tile.h"

Go to the source code of this file.

Functions

void tile_set_owner (struct tile *ptile, struct player *pplayer, struct tile *claimer)
 
struct citytile_city (const struct tile *ptile)
 
void tile_set_worked (struct tile *ptile, struct city *pcity)
 
void tile_set_terrain (struct tile *ptile, struct terrain *pterrain)
 
const bv_extrastile_extras_null (void)
 
const bv_extrastile_extras_safe (const struct tile *ptile)
 
int tile_has_not_aggressive_extra_for_unit (const struct tile *ptile, const struct unit_type *punittype)
 
bool tile_has_claimable_base (const struct tile *ptile, const struct unit_type *punittype)
 
int tile_extras_defense_bonus (const struct tile *ptile, const struct unit_type *punittype)
 
int tile_extras_class_defense_bonus (const struct tile *ptile, const struct unit_class *pclass)
 
int tile_roads_output_incr (const struct tile *ptile, enum output_type_id o)
 
int tile_roads_output_bonus (const struct tile *ptile, enum output_type_id o)
 
bool tile_has_refuel_extra (const struct tile *ptile, const struct unit_class *uclass)
 
bool tile_has_native_base (const struct tile *ptile, const struct unit_type *punittype)
 
void tile_set_resource (struct tile *ptile, struct extra_type *presource)
 
void tile_set_continent (struct tile *ptile, Continent_id val)
 
enum known_type tile_get_known (const struct tile *ptile, const struct player *pplayer)
 
bool tile_is_seen (const struct tile *target_tile, const struct player *pow_player)
 
int tile_activity_time (enum unit_activity activity, const struct tile *ptile, const struct extra_type *tgt)
 
static void tile_create_extra (struct tile *ptile, struct extra_type *pextra)
 
static void tile_destroy_extra (struct tile *ptile, struct extra_type *pextra)
 
void tile_change_terrain (struct tile *ptile, struct terrain *pterrain)
 
static bool add_recursive_extras (struct tile *ptile, struct extra_type *pextra, int rec)
 
static bool rm_recursive_extras (struct tile *ptile, struct extra_type *pextra, int rec)
 
bool tile_extra_apply (struct tile *ptile, struct extra_type *tgt)
 
bool tile_extra_rm_apply (struct tile *ptile, struct extra_type *tgt)
 
static void tile_irrigate (struct tile *ptile, struct extra_type *tgt)
 
static void tile_mine (struct tile *ptile, struct extra_type *tgt)
 
static void tile_transform (struct tile *ptile)
 
static void tile_plant (struct tile *ptile)
 
static void tile_cultivate (struct tile *ptile)
 
bool tile_apply_activity (struct tile *ptile, Activity_type_id act, struct extra_type *tgt)
 
static bool tile_info_pollution (char *buf, int bufsz, const struct tile *ptile, struct extra_type *pextra, bool prevp, bool linebreak)
 
const chartile_get_info_text (const struct tile *ptile, bool include_nuisances, int linebreaks)
 
bool tile_has_base (const struct tile *ptile, const struct base_type *pbase)
 
bool tile_has_road (const struct tile *ptile, const struct road_type *proad)
 
bool tile_has_river (const struct tile *ptile)
 
bool tile_has_road_flag (const struct tile *ptile, enum road_flag_id flag)
 
bool tile_has_extra_flag (const struct tile *ptile, enum extra_flag_id flag)
 
bool tile_has_conflicting_extra (const struct tile *ptile, const struct extra_type *pextra)
 
bool tile_has_visible_extra (const struct tile *ptile, const struct extra_type *pextra)
 
bool tile_has_cause_extra (const struct tile *ptile, enum extra_cause cause)
 
void tile_add_extra (struct tile *ptile, const struct extra_type *pextra)
 
void tile_remove_extra (struct tile *ptile, const struct extra_type *pextra)
 
struct tiletile_virtual_new (const struct tile *ptile)
 
void tile_virtual_destroy (struct tile *vtile)
 
bool tile_map_check (struct civ_map *nmap, struct tile *vtile)
 
voidtile_hash_key (const struct tile *ptile)
 
bool tile_set_label (struct tile *ptile, const char *label)
 
bool tile_is_placing (const struct tile *ptile)
 

Variables

static bv_extras empty_extras
 

Function Documentation

◆ add_recursive_extras()

static bool add_recursive_extras ( struct tile ptile,
struct extra_type pextra,
int  rec 
)
static

Recursively add all extra dependencies to add given extra.

Definition at line 513 of file tile.c.

Referenced by add_recursive_extras(), and tile_extra_apply().

◆ rm_recursive_extras()

static bool rm_recursive_extras ( struct tile ptile,
struct extra_type pextra,
int  rec 
)
static

Recursively remove all extras depending on given extra.

Definition at line 541 of file tile.c.

Referenced by rm_recursive_extras(), and tile_extra_rm_apply().

◆ tile_activity_time()

int tile_activity_time ( enum unit_activity  activity,
const struct tile ptile,
const struct extra_type tgt 
)

Time to complete the given activity on the given tile.

See also action_get_act_time()

Definition at line 418 of file tile.c.

Referenced by actres_get_act_time(), calc_activity(), get_turns_for_activity_at(), total_activity_done(), and update_unit_activity().

◆ tile_add_extra()

void tile_add_extra ( struct tile ptile,
const struct extra_type pextra 
)

◆ tile_apply_activity()

bool tile_apply_activity ( struct tile ptile,
Activity_type_id  act,
struct extra_type tgt 
)

Apply an activity (Activity_type_id, e.g., ACTIVITY_TRANSFORM) to a tile. Return false if there was a error or if the activity is not implemented by this function.

Definition at line 681 of file tile.c.

Referenced by get_tile_change_menu_text(), get_tile_change_menu_text(), get_tile_value(), and update_unit_activity().

◆ tile_change_terrain()

void tile_change_terrain ( struct tile ptile,
struct terrain pterrain 
)

Change the terrain to the given type. This does secondary tile updates to the tile (as will happen when mining/irrigation/transforming changes the tile's terrain).

Definition at line 496 of file tile.c.

Referenced by adv_calc_cultivate(), adv_calc_plant(), adv_calc_transform(), api_edit_change_terrain(), check_terrain_change(), climate_change(), edit_tile_terrain_handling(), regenerate_lakes(), tile_cultivate(), tile_plant(), and tile_transform().

◆ tile_city()

struct city * tile_city ( const struct tile ptile)

Return the city on this tile (or NULL), checking for city center.

Definition at line 83 of file tile.c.

Referenced by action_maybe_possible_actor_unit(), action_prob_self_full(), action_prob_vs_city_full(), action_prob_vs_extras_full(), action_prob_vs_stack_full(), action_prob_vs_tile_full(), action_prob_vs_unit_full(), action_success_target_pay_mp(), action_tgt_city(), actres_possible(), trade_generator::add_tile(), adv_calc_cultivate(), adv_calc_plant(), adv_calc_transform(), adv_danger_at(), ap_dipl_battle_win(), api_edit_change_terrain(), api_edit_create_unit_full(), api_edit_tile_hide(), api_edit_unit_teleport(), api_effects_unit_bonus(), api_methods_enemy_tile(), api_methods_tile_city(), auto_settlers_speculate_can_act_at(), blocked_find_target_city(), build_landarea_map(), butt_down_mapcanvas(), button_up_on_map(), calculate_city_clusters(), calculate_want_for_paratrooper(), can_build_extra_base(), can_create_unit_at_tile(), can_exist_at_tile(), can_extra_be_removed(), can_player_attack_tile(), can_player_see_hypotetic_units_at(), can_player_see_unit_at(), can_step_taken_wrt_to_zoc(), can_unit_change_homecity(), can_unit_survive_at_tile(), can_unit_unload(), caravan_search_from(), casus_belli_range_for(), check_city_migrations_player(), city_build(), city_desirability(), city_dialog_redraw_map(), city_exists_within_max_city_map(), city_landlocked_sell_coastal_improvements(), citymindist_prevents_city_on_tile(), cityresult_fill(), client_plr_tile_city_id_get(), client_remove_unit(), climate_change(), clipboard_copy_production(), control_mouse_cursor(), could_unit_load(), dai_airlift(), dai_auto_settler_run(), dai_consider_tile_dangerous(), dai_data_phase_begin(), dai_diplomat_bribe_nearby(), dai_diplomat_defend(), dai_do_build_city(), dai_effect_value(), dai_find_boat_for_unit(), dai_find_strategic_airbase(), dai_gothere_bodyguard(), dai_hunter_manage(), dai_hunter_try_launch(), dai_manage_airunit(), dai_manage_caravan(), dai_manage_diplomat(), dai_manage_hitpoint_recovery(), dai_manage_military(), dai_manage_paratrooper(), dai_military_defend(), dai_rampage_want(), dai_should_we_air_attack_tile(), dai_unit_attack(), dai_unit_new_task(), dai_wonder_city_distance(), debug_command(), defense_multiplication(), define_tiles_within_rectangle(), diplomat_bribe(), diplomat_infiltrate_tile(), diplomat_success_vs_defender(), disband_all_units(), do_airline(), do_attack(), do_capture_units(), do_disband_alternative(), do_heal_unit(), do_map_click(), do_move_unit(), do_nuke_tile(), do_paradrop(), do_unit_paradrop_to(), do_unit_teleport_to(), draw_calculated_trade_routes(), edit_buffer_copy(), edit_tile_terrain_handling(), editor_apply_tool(), editor_grab_applied_player(), editor_grab_tool(), execute_orders(), expl_act_not_enabl(), find_a_good_partisan_spot(), find_beachhead(), find_best_city_placement(), find_best_tile_to_paradrop_to(), find_city_or_settler_near_tile(), find_city_to_diplomat(), find_nearest_safe_city(), find_something_to_kill(), find_visible_unit(), get_airlift_text(), get_modified_firepower(), get_nearest_city(), get_tile_bonus(), get_total_attack_power(), get_unit_bonus(), get_unit_vs_tile_bonus(), get_unittype_bonus(), give_distorted_map(), gui_refresh_unit_city_dialogs(), handle_edit_city_create(), handle_edit_player_vision(), handle_edit_unit_create(), handle_unit_packet_common(), handle_unit_type_upgrade(), inputline_make_chat_link(), notify_goto::inspect_city(), invasion_funct(), is_action_enabled_unit_on_city_full(), is_action_enabled_unit_on_extras_full(), is_action_enabled_unit_on_self_full(), is_action_enabled_unit_on_stack_full(), is_action_enabled_unit_on_tile_full(), is_action_enabled_unit_on_unit_full(), is_border_source(), is_building_req_active(), is_buildingflag_req_active(), is_city_channel_tile(), is_city_in_tile(), is_friendly_city_near(), is_native_tile_to_extra(), is_req_knowable(), is_stack_vulnerable(), is_unit_reachable_at(), kill_something_with(), kill_unit(), look_for_charge(), main_key_down_handler(), main_key_down_handler(), chatwdg::make_link(), map_change_seen(), map_claim_border(), map_show_tile(), mapimg_client_tile_city(), mapimg_server_tile_city(), maybe_make_contact(), mr_menu::menus_sensitive(), meswin_add(), meswin_popup_city(), middle_present_unit_release(), need_war_player_hlp(), notify_goto::notify_goto(), notify_goto_dialog_goto_callback(), notify_goto_response(), occupy_move(), overview_tile_color(), paste_tile(), pf_danger_map_iterate(), pf_danger_node_init(), pf_fuel_map_iterate(), pf_fuel_node_init(), pf_get_move_scope(), pf_normal_map_new(), pf_normal_node_init(), place_animal(), player_in_city_map(), player_may_explore(), popup_advanced_terrain_dialog(), popup_info_text(), popup_notify_goto_dialog(), present_unit_activate_close_callback(), present_unit_activate_close_callback(), present_unit_callback(), present_unit_callback(), present_unit_middle_callback(), process_attacker_want(), property_page_add_objbinds_from_tile(), put_one_tile(), qtg_refresh_unit_city_dialogs(), rally_set_tile(), real_menus_update(), reality_check_city(), redraw_unit_info_label(), refresh_unit_city_dialogs(), remove_city(), request_unit_build_city(), request_unit_caravan_action(), request_unit_change_homecity(), request_unit_upgrade(), right_butt_down_mapcanvas(), sdi_try_defend(), send_city_info_at_tile(), server_remove_unit_full(), sg_load_player_city(), sg_load_player_city(), sg_load_player_vision(), sg_load_player_vision(), sg_order_to_action(), sg_special_set_bv(), sg_special_set_dbv(), map_view::shortcut_pressed(), show_city_descriptions(), terrain_changed(), test_unit_can_airlift_to(), throw_units_from_illegal_cities(), tile_allied_city(), tile_border_source_radius_sq(), tile_border_source_strength(), tile_enemy_city(), tile_move_cost_ptrs(), tile_non_allied_city(), tile_non_attack_city(), tile_set_owner(), tile_set_terrain(), tile_virtual_destroy(), toggle_tile_hilite(), transfer_city_units(), transfer_unit(), unit_being_aggressive(), unit_bombard(), unit_can_add_or_build_city(), unit_can_est_trade_route_here(), unit_can_help_build_wonder_here(), unit_change_homecity_handling(), unit_do_disband_trad(), unit_foodbox_cost(), unit_gain_hitpoints(), unit_move(), unit_move_consequences(), unit_move_to_tile_test(), unit_pays_mp_for_action(), unit_perform_action(), unit_select_dialog_popup(), unit_survive_autoattack(), unit_teleport_to_tile_test(), unit_upgrade_test(), unit_actions::update_actions(), update_source_label(), usdlg_check_unit_location(), utype_pays_mp_for_action_estimate(), and wakeup_neighbor_sentries().

◆ tile_create_extra()

static void tile_create_extra ( struct tile ptile,
struct extra_type pextra 
)
static

Create extra to tile.

Definition at line 468 of file tile.c.

Referenced by add_recursive_extras().

◆ tile_cultivate()

static void tile_cultivate ( struct tile ptile)
static

Cultivate (ACTIVITY_CULTIVATE) the tile. This usually changes the tile's terrain type.

Definition at line 667 of file tile.c.

Referenced by tile_apply_activity().

◆ tile_destroy_extra()

static void tile_destroy_extra ( struct tile ptile,
struct extra_type pextra 
)
static

Destroy extra from tile.

Definition at line 481 of file tile.c.

Referenced by rm_recursive_extras(), tile_change_terrain(), and tile_extra_apply().

◆ tile_extra_apply()

bool tile_extra_apply ( struct tile ptile,
struct extra_type tgt 
)

Add extra and adjust other extras accordingly.

If not all necessary adjustments can be done, returns FALSE. When problem occurs, changes to tile extras are not reverted. Pass virtual tile to the function if you are not sure it will success and don't want extras adjusted at all in case of failure.

Definition at line 575 of file tile.c.

Referenced by edit_tile_extra_handling(), end_turn(), tile_irrigate(), and tile_mine().

◆ tile_extra_rm_apply()

bool tile_extra_rm_apply ( struct tile ptile,
struct extra_type tgt 
)

Remove extra and adjust other extras accordingly.

If not all necessary adjustments can be done, returns FALSE. When problem occurs, changes to tile extras are not reverted. Pass virtual tile to the function if you are not sure it will success and don't want extras adjusted at all in case of failure.

Definition at line 601 of file tile.c.

Referenced by api_edit_remove_extra(), edit_tile_extra_handling(), end_turn(), place_starting_unit(), remove_city(), remove_tiny_islands(), and try_summon_barbarians().

◆ tile_extras_class_defense_bonus()

int tile_extras_class_defense_bonus ( const struct tile ptile,
const struct unit_class pclass 
)

Calculate defense bonus given for unit class by extras.

Definition at line 242 of file tile.c.

Referenced by chance_killed_at(), and tile_extras_defense_bonus().

◆ tile_extras_defense_bonus()

int tile_extras_defense_bonus ( const struct tile ptile,
const struct unit_type punittype 
)

Calculate defense bonus given for unit type by bases and roads

Definition at line 233 of file tile.c.

Referenced by adv_danger_at(), dai_consider_tile_dangerous(), defense_multiplication(), and kill_unit().

◆ tile_extras_null()

const bv_extras * tile_extras_null ( void  )

Returns a bit vector of the extras present at NULL tile.

Definition at line 166 of file tile.c.

Referenced by tile_extras_safe().

◆ tile_extras_safe()

const bv_extras * tile_extras_safe ( const struct tile ptile)

Returns a bit vector of the extras present at the tile.

Definition at line 181 of file tile.c.

◆ tile_get_info_text()

const char * tile_get_info_text ( const struct tile ptile,
bool  include_nuisances,
int  linebreaks 
)

Return a (static) string with tile name describing terrain and extras of some categories. If include_nuisances is set, pollution and nuclear fallout will be ignored.

Examples: "Hills" "Hills (Coals)" "Hills (Coals) [Pollution]"

Definition at line 771 of file tile.c.

Referenced by dai_auto_settler_run(), get_tile_change_menu_text(), get_tile_change_menu_text(), get_unit_info_label_text2(), popup_info_text(), and popup_terrain_info().

◆ tile_get_known()

enum known_type tile_get_known ( const struct tile ptile,
const struct player pplayer 
)

◆ tile_has_base()

bool tile_has_base ( const struct tile ptile,
const struct base_type pbase 
)

Returns TRUE if the given tile has a base of given type on it.

Definition at line 836 of file tile.c.

◆ tile_has_cause_extra()

bool tile_has_cause_extra ( const struct tile ptile,
enum extra_cause  cause 
)

Has tile any extras of the specified cause.

Definition at line 941 of file tile.c.

◆ tile_has_claimable_base()

bool tile_has_claimable_base ( const struct tile ptile,
const struct unit_type punittype 
)

Check if tile contains base providing effect for unit.

Definition at line 215 of file tile.c.

Referenced by actres_possible(), dai_unit_attack(), maybe_claim_base(), sg_load_player_units(), and unit_move().

◆ tile_has_conflicting_extra()

bool tile_has_conflicting_extra ( const struct tile ptile,
const struct extra_type pextra 
)

Returns TRUE if the given tile has a extra conflicting with the given one.

Definition at line 901 of file tile.c.

Referenced by upgrade_city_extras().

◆ tile_has_extra_flag()

bool tile_has_extra_flag ( const struct tile ptile,
enum extra_flag_id  flag 
)

Check if tile contains extra providing effect

Definition at line 886 of file tile.c.

Referenced by is_extraflag_req_active(), and is_stack_vulnerable().

◆ tile_has_native_base()

bool tile_has_native_base ( const struct tile ptile,
const struct unit_type punittype 
)

◆ tile_has_not_aggressive_extra_for_unit()

int tile_has_not_aggressive_extra_for_unit ( const struct tile ptile,
const struct unit_type punittype 
)

Check if tile contains extra making unit not aggressive.

Maximum distance to nearest friendly city to make extra effective returned. Negative distance means that there's no such extra.

Definition at line 196 of file tile.c.

Referenced by unit_being_aggressive(), and unit_move_consequences().

◆ tile_has_refuel_extra()

bool tile_has_refuel_extra ( const struct tile ptile,
const struct unit_class uclass 
)

Check if tile contains refuel extra native for unit class

Definition at line 309 of file tile.c.

Referenced by can_unit_survive_at_tile().

◆ tile_has_river()

bool tile_has_river ( const struct tile ptile)

Tile has any river type

Definition at line 852 of file tile.c.

Referenced by count_river_near_tile(), fill_island_rivers(), is_terrain_ecologically_wet(), and make_rivers().

◆ tile_has_road()

bool tile_has_road ( const struct tile ptile,
const struct road_type proad 
)

Returns TRUE if the given tile has a road of given type on it.

Definition at line 844 of file tile.c.

Referenced by adv_settlers_road_bonus(), can_unit_do_connect(), count_road_near_tile(), get_connect_road(), popup_terrain_info(), and road_can_be_built().

◆ tile_has_road_flag()

bool tile_has_road_flag ( const struct tile ptile,
enum road_flag_id  flag 
)

Check if tile contains road providing effect

Definition at line 868 of file tile.c.

Referenced by is_roadflag_req_active().

◆ tile_has_visible_extra()

bool tile_has_visible_extra ( const struct tile ptile,
const struct extra_type pextra 
)

Returns TRUE if the given tile has an extra of the given type on it.

Definition at line 917 of file tile.c.

Referenced by popup_info_text(), tile_get_info_text(), and tile_info_pollution().

◆ tile_hash_key()

void * tile_hash_key ( const struct tile ptile)

Returns key that should be used when storing tile to hash or when retrieving it from there.

Definition at line 1083 of file tile.c.

Referenced by map_startpos_get(), map_startpos_new(), and map_startpos_remove().

◆ tile_info_pollution()

static bool tile_info_pollution ( char buf,
int  bufsz,
const struct tile ptile,
struct extra_type pextra,
bool  prevp,
bool  linebreak 
)
static

Add one entry about pollution situation to buffer. Return if there has been any pollution (even prior calling this)

Definition at line 736 of file tile.c.

Referenced by tile_get_info_text().

◆ tile_irrigate()

static void tile_irrigate ( struct tile ptile,
struct extra_type tgt 
)
static

Build irrigation on the tile. This may change the extras of the tile or change the terrain type itself.

Definition at line 615 of file tile.c.

Referenced by tile_apply_activity().

◆ tile_is_placing()

bool tile_is_placing ( const struct tile ptile)

Is there a placing ongoing?

Definition at line 1129 of file tile.c.

Referenced by can_unit_do_activity_targeted_at().

◆ tile_is_seen()

bool tile_is_seen ( const struct tile target_tile,
const struct player pow_player 
)

Returns TRUE iff the target_tile is seen by pow_player.

Definition at line 407 of file tile.c.

Referenced by action_prob_vs_stack_full(), handle_unit_get_actions(), is_req_knowable(), is_tile_seen_adj(), is_tile_seen_cadj(), is_tile_seen_city(), and player_can_see_city_externals().

◆ tile_map_check()

bool tile_map_check ( struct civ_map nmap,
struct tile vtile 
)

Check if the given tile is on a map.

Definition at line 1065 of file tile.c.

Referenced by destroy_extra(), and tile_set_terrain().

◆ tile_mine()

static void tile_mine ( struct tile ptile,
struct extra_type tgt 
)
static

Build a mine on the tile. This may change the extras of the tile or change the terrain type itself.

Definition at line 628 of file tile.c.

Referenced by tile_apply_activity().

◆ tile_plant()

static void tile_plant ( struct tile ptile)
static

Plant (ACTIVITY_PLANT) the tile. This usually changes the tile's terrain type.

Definition at line 654 of file tile.c.

Referenced by tile_apply_activity().

◆ tile_remove_extra()

void tile_remove_extra ( struct tile ptile,
const struct extra_type pextra 
)

Removes extra from tile if such exist

Definition at line 965 of file tile.c.

Referenced by adv_calc_extra(), adv_calc_rmextra(), can_extra_be_removed(), destroy_extra(), get_tile_infrastructure_set(), tile_destroy_extra(), and tile_set_resource().

◆ tile_roads_output_bonus()

int tile_roads_output_bonus ( const struct tile ptile,
enum output_type_id  o 
)

Calculate output bonus given by roads

Definition at line 291 of file tile.c.

Referenced by city_tile_output().

◆ tile_roads_output_incr()

int tile_roads_output_incr ( const struct tile ptile,
enum output_type_id  o 
)

Calculate output increment given by roads

Definition at line 271 of file tile.c.

Referenced by city_tile_output().

◆ tile_set_continent()

void tile_set_continent ( struct tile ptile,
Continent_id  val 
)

Set the continent ID of the tile. See tile_continent.

Definition at line 382 of file tile.c.

Referenced by assign_continent_flood(), assign_continent_numbers(), initworld(), make_polar_land(), map_generate_fair_islands(), place_island(), and remove_tiny_islands().

◆ tile_set_label()

bool tile_set_label ( struct tile ptile,
const char label 
)

Sets label for tile. Returns whether label changed.

Definition at line 1095 of file tile.c.

Referenced by api_edit_tile_set_label(), handle_edit_tile(), handle_tile_info(), sg_load_map_tiles(), and sg_load_map_tiles().

◆ tile_set_owner()

void tile_set_owner ( struct tile ptile,
struct player pplayer,
struct tile claimer 
)

Set the owner of a tile (may be NULL).

Definition at line 69 of file tile.c.

Referenced by cityresult_fill(), create_city(), handle_tile_info(), initworld(), map_claim_border_ownership(), map_generate_fair_islands(), and remove_player_from_maps().

◆ tile_set_resource()

void tile_set_resource ( struct tile ptile,
struct extra_type presource 
)

◆ tile_set_terrain()

void tile_set_terrain ( struct tile ptile,
struct terrain pterrain 
)

◆ tile_set_worked()

void tile_set_worked ( struct tile ptile,
struct city pcity 
)

◆ tile_transform()

static void tile_transform ( struct tile ptile)
static

Transform (ACTIVITY_TRANSFORM) the tile. This usually changes the tile's terrain type.

Definition at line 641 of file tile.c.

Referenced by tile_apply_activity().

◆ tile_virtual_destroy()

void tile_virtual_destroy ( struct tile vtile)

◆ tile_virtual_new()

struct tile * tile_virtual_new ( const struct tile ptile)

Returns a virtual tile. If ptile is given, the properties of this tile are copied, else it is completely blank (except for the unit list vtile->units, which is created for you). Be sure to call tile_virtual_free on it when it is no longer needed.

Definition at line 981 of file tile.c.

Referenced by adv_calc_cultivate(), adv_calc_extra(), adv_calc_plant(), adv_calc_rmextra(), adv_calc_transform(), can_extra_be_removed(), can_unit_do_connect(), check_native_area(), edit_buffer_copy(), fair_map_make_huts(), get_activity_time(), get_tile_change_menu_text(), get_tile_change_menu_text(), get_tile_infrastructure_set(), get_tile_value(), goto_dialog::init(), result_defense_bonus(), sg_special_set_bv(), and sg_special_set_dbv().

Variable Documentation

◆ empty_extras

bv_extras empty_extras
static

Definition at line 34 of file tile.c.

Referenced by tile_extras_null().