Freeciv-3.2
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
tile.h File Reference
#include "bitvector.h"
#include "base.h"
#include "extras.h"
#include "fc_types.h"
#include "road.h"
#include "terrain.h"
#include "unitlist.h"
#include "speclist.h"
#include "spechash.h"

Go to the source code of this file.

Data Structures

struct  tile
 

Macros

#define TILE_XY(ptile)
 
#define TILE_INDEX_NONE   (-1)
 
#define SPECLIST_TAG   tile
 
#define SPECLIST_TYPE   struct tile
 
#define tile_list_iterate(tile_list, ptile)    TYPED_LIST_ITERATE(struct tile, tile_list, ptile)
 
#define tile_list_iterate_end   LIST_ITERATE_END
 
#define SPECHASH_TAG   tile
 
#define SPECHASH_IKEY_TYPE   struct tile *
 
#define SPECHASH_IDATA_TYPE   void *
 
#define tile_hash_iterate(hash, ptile)    TYPED_HASH_KEYS_ITERATE(struct tile *, hash, ptile)
 
#define tile_hash_iterate_end   HASH_KEYS_ITERATE_END
 
#define tile_index(_pt_)   (_pt_)->index
 
#define tile_continent(_tile)   ((_tile)->continent)
 
#define tile_owner(_tile)   ((_tile)->owner)
 
#define tile_claimer(_tile)   ((_tile)->claimer)
 
#define tile_resource(_tile)   ((_tile)->resource)
 
#define tile_terrain(_tile)   ((_tile)->terrain)
 
#define tile_worked(_tile)   ((_tile)->worked)
 
#define tile_has_extra(ptile, pextra)   BV_ISSET(ptile->extras, extra_index(pextra))
 
#define ACTIVITY_FACTOR   10
 
#define TILE_LB_TERRAIN_RIVER   (1 << 0)
 
#define TILE_LB_RIVER_RESOURCE   (1 << 1)
 
#define TILE_LB_RESOURCE_POLL   (1 << 2)
 

Enumerations

enum  known_type { TILE_UNKNOWN = 0 , TILE_KNOWN_UNSEEN = 1 , TILE_KNOWN_SEEN = 2 }
 

Functions

struct citytile_city (const struct tile *ptile)
 
void tile_set_continent (struct tile *ptile, Continent_id val)
 
void tile_set_owner (struct tile *ptile, struct player *pplayer, struct tile *claimer)
 
static bool tile_resource_is_valid (const struct tile *ptile)
 
void tile_set_resource (struct tile *ptile, struct extra_type *presource)
 
void tile_set_terrain (struct tile *ptile, struct terrain *pterrain)
 
void tile_set_worked (struct tile *ptile, struct city *pcity)
 
const bv_extrastile_extras_safe (const struct tile *ptile)
 
const bv_extrastile_extras_null (void)
 
static const bv_extrastile_extras (const struct tile *ptile)
 
bool tile_has_base (const struct tile *ptile, const struct base_type *pbase)
 
int tile_has_not_aggressive_extra_for_unit (const struct tile *ptile, const struct unit_type *punittype)
 
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)
 
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)
 
bool tile_has_road (const struct tile *ptile, const struct road_type *proad)
 
bool tile_has_road_flag (const struct tile *ptile, enum road_flag_id flag)
 
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_river (const struct tile *tile)
 
bool tile_extra_apply (struct tile *ptile, struct extra_type *tgt)
 
bool tile_extra_rm_apply (struct tile *ptile, struct extra_type *tgt)
 
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)
 
bool tile_has_extra_flag (const struct tile *ptile, enum extra_flag_id flag)
 
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)
 
void tile_change_terrain (struct tile *ptile, struct terrain *pterrain)
 
bool tile_apply_activity (struct tile *ptile, Activity_type_id act, struct extra_type *tgt)
 
const chartile_get_info_text (const struct tile *ptile, bool include_nuisances, int linebreaks)
 
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)
 

Macro Definition Documentation

◆ ACTIVITY_FACTOR

#define ACTIVITY_FACTOR   10

Definition at line 165 of file tile.h.

◆ SPECHASH_IDATA_TYPE

#define SPECHASH_IDATA_TYPE   void *

Definition at line 80 of file tile.h.

◆ SPECHASH_IKEY_TYPE

#define SPECHASH_IKEY_TYPE   struct tile *

Definition at line 79 of file tile.h.

◆ SPECHASH_TAG

#define SPECHASH_TAG   tile

Definition at line 78 of file tile.h.

◆ SPECLIST_TAG

#define SPECLIST_TAG   tile

Definition at line 70 of file tile.h.

◆ SPECLIST_TYPE

#define SPECLIST_TYPE   struct tile

Definition at line 71 of file tile.h.

◆ tile_claimer

#define tile_claimer (   _tile)    ((_tile)->claimer)

Definition at line 100 of file tile.h.

◆ tile_continent

#define tile_continent (   _tile)    ((_tile)->continent)

Definition at line 92 of file tile.h.

◆ tile_has_extra

#define tile_has_extra (   ptile,
  pextra 
)    BV_ISSET(ptile->extras, extra_index(pextra))

Definition at line 147 of file tile.h.

◆ tile_hash_iterate

#define tile_hash_iterate (   hash,
  ptile 
)     TYPED_HASH_KEYS_ITERATE(struct tile *, hash, ptile)

Definition at line 82 of file tile.h.

◆ tile_hash_iterate_end

#define tile_hash_iterate_end   HASH_KEYS_ITERATE_END

Definition at line 84 of file tile.h.

◆ tile_index

#define tile_index (   _pt_)    (_pt_)->index

Definition at line 88 of file tile.h.

◆ TILE_INDEX_NONE

#define TILE_INDEX_NONE   (-1)

Definition at line 48 of file tile.h.

◆ TILE_LB_RESOURCE_POLL

#define TILE_LB_RESOURCE_POLL   (1 << 2)

Definition at line 177 of file tile.h.

◆ TILE_LB_RIVER_RESOURCE

#define TILE_LB_RIVER_RESOURCE   (1 << 1)

Definition at line 176 of file tile.h.

◆ TILE_LB_TERRAIN_RIVER

#define TILE_LB_TERRAIN_RIVER   (1 << 0)

Definition at line 175 of file tile.h.

◆ tile_list_iterate

#define tile_list_iterate (   tile_list,
  ptile 
)     TYPED_LIST_ITERATE(struct tile, tile_list, ptile)

Definition at line 73 of file tile.h.

◆ tile_list_iterate_end

#define tile_list_iterate_end   LIST_ITERATE_END

Definition at line 75 of file tile.h.

◆ tile_owner

#define tile_owner (   _tile)    ((_tile)->owner)

Definition at line 96 of file tile.h.

◆ tile_resource

#define tile_resource (   _tile)    ((_tile)->resource)

Definition at line 102 of file tile.h.

◆ tile_terrain

#define tile_terrain (   _tile)    ((_tile)->terrain)

Definition at line 110 of file tile.h.

◆ tile_worked

#define tile_worked (   _tile)    ((_tile)->worked)

Definition at line 114 of file tile.h.

◆ TILE_XY

#define TILE_XY (   ptile)
Value:
((ptile) ? index_to_map_pos_x(tile_index(ptile)) \
: -1), \
((ptile) ? index_to_map_pos_y(tile_index(ptile)) \
: -1)
static int index_to_map_pos_y(int mindex)
Definition map.h:724
static int index_to_map_pos_x(int mindex)
Definition map.h:715
#define tile_index(_pt_)
Definition tile.h:88

Definition at line 43 of file tile.h.

Enumeration Type Documentation

◆ known_type

Enumerator
TILE_UNKNOWN 
TILE_KNOWN_UNSEEN 
TILE_KNOWN_SEEN 

Definition at line 35 of file tile.h.

Function Documentation

◆ 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_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()

static const bv_extras * tile_extras ( const struct tile ptile)
inlinestatic

◆ 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_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_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_resource_is_valid()

static bool tile_resource_is_valid ( const struct tile ptile)
inlinestatic

Definition at line 103 of file tile.h.

Referenced by city_tile_output(), and tile_get_info_text().

◆ 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_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().