Freeciv-3.2
Loading...
Searching...
No Matches
Data Fields
unit Struct Reference

#include <unit.h>

Data Fields

const struct unit_typeutype
 
struct tiletile
 
int refcount
 
enum direction8 facing
 
struct playerowner
 
struct playernationality
 
int id
 
int homecity
 
int upkeep [O_LAST]
 
int moves_left
 
int hp
 
int veteran
 
int fuel
 
struct tilegoto_tile
 
enum unit_activity activity
 
int activity_count
 
struct extra_typeactivity_target
 
enum unit_activity changed_from
 
int changed_from_count
 
struct extra_typechanged_from_target
 
enum server_side_agent ssa_controller
 
bool moved
 
bool paradropped
 
bool done_moving
 
struct unittransporter
 
struct unit_list * transporting
 
struct goods_typecarrying
 
int battlegroup
 
bool has_orders
 
struct { 
 
   int   length 
 
   int   index 
 
   bool   repeat 
 
   bool   vigilant 
 
   struct unit_order *   list 
 
orders 
 
enum action_decision action_decision_want
 
struct tileaction_decision_tile
 
bool stay
 
int birth_turn
 
int current_form_turn
 
union { 
 
   struct { 
 
      enum unit_focus_status   focus_status 
 
      int   transported_by 
 
      bool   occupied 
 
      bool   colored 
 
      int   color_index 
 
      bool   asking_city_name 
 
      struct act_prob *   act_prob_cache 
 
   }   client 
 
   struct { 
 
      bool   debug 
 
      struct unit_adv *   adv 
 
      void *   ais [FREECIV_AI_MOD_LAST
 
      int   ord_map 
 
      int   ord_city 
 
      struct vision *   vision 
 
      time_t   action_timestamp 
 
      int   action_turn 
 
      struct unit_move_data *   moving 
 
      bool   dying 
 
      void(*   removal_callback )(struct unit *punit
 
      int   upkeep_paid [O_LAST
 
   }   server 
 
};  
 

Detailed Description

Definition at line 138 of file unit.h.

Field Documentation

◆ [union]

union { ... } unit

◆ act_prob_cache

struct act_prob* unit::act_prob_cache

◆ action_decision_tile

struct tile* unit::action_decision_tile

◆ action_decision_want

enum action_decision unit::action_decision_want

◆ action_timestamp

time_t unit::action_timestamp

Definition at line 245 of file unit.h.

Referenced by unit_can_do_action_now(), unit_did_action(), and unit_virtual_create().

◆ action_turn

int unit::action_turn

Definition at line 246 of file unit.h.

Referenced by unit_can_do_action_now(), unit_did_action(), and unit_virtual_create().

◆ activity

enum unit_activity unit::activity

Definition at line 157 of file unit.h.

Referenced by unit_hud_selector::activity_filter(), adv_follow_path(), adv_settlers_road_bonus(), auto_settler_setup_work(), auto_settlers_player(), begin_phase(), calc_activity(), can_unit_continue_current_activity(), can_unit_move_to_tile_with_notify(), can_units_do_activity(), can_units_do_activity_targeted(), check_unit_activity(), clear_unit_orders(), climate_change(), compat_post_load_030100(), create_unit_menu(), dai_manage_airunit(), dai_manage_military(), dai_military_attack(), dai_unit_goto_constrained(), dai_unit_new_task(), do_explore(), do_move_unit(), execute_orders(), expl_act_not_enabl(), fill_unit_sprite_array(), finalize_unit_phase_beginning(), find_best_focus_candidate(), get_fortified_defense_power(), get_unit_tile_pillage_set(), handle_player_diplstate(), handle_unit_change_activity(), handle_unit_change_activity_real(), handle_unit_orders(), handle_unit_packet_common(), handle_unit_sscs_set(), is_activity_on_tile(), is_unit_activity_on_tile(), package_short_unit(), package_unit(), place_partisans(), player_can_place_extra(), present_unit_callback(), real_unit_log(), request_unit_fortify(), request_unit_move_done(), request_unit_sentry(), select_tgt_extra(), select_tgt_unit(), set_unit_activity_internal(), sg_load_players(), sg_load_players(), sg_save_player_units(), terrain_change_bounce_single_unit(), texai_tile_worker_task_select(), total_activity(), unit_activity_astr(), unit_activity_dependencies(), unit_activity_internal(), unit_activity_targeted_internal(), unit_can_move_to_tile(), unit_can_teleport_to_tile(), unit_focus_advance(), unit_focus_update(), unit_restore_hitpoints(), unit_upgrade_info(), unit_upgrade_test(), units_orders_city_dlg_callback(), units_report_command_callback(), unpackage_short_unit(), unpackage_unit(), update_unit_activity(), upgrade_server_side_agent(), usdlg_check_unit_activity(), usdlg_cmd_cursor_changed(), usdlg_cmd_exec_unit(), wakeup_sentried_units(), and unittype_item::wheelEvent().

◆ activity_count

int unit::activity_count

◆ activity_target

struct extra_type* unit::activity_target

◆ adv

struct unit_adv* unit::adv

◆ ais

Definition at line 237 of file unit.h.

Referenced by unit_ai_data(), and unit_set_ai_data().

◆ asking_city_name

bool unit::asking_city_name

Definition at line 225 of file unit.h.

Referenced by cancel_city(), finish_city(), handle_city_name_suggestion_info(), and unpackage_unit().

◆ battlegroup

int unit::battlegroup

◆ birth_turn

int unit::birth_turn

◆ carrying

struct goods_type* unit::carrying

◆ changed_from

enum unit_activity unit::changed_from

◆ changed_from_count

int unit::changed_from_count

◆ changed_from_target

struct extra_type* unit::changed_from_target

◆ [struct]

struct { ... } unit::client

◆ color_index

int unit::color_index

Definition at line 223 of file unit.h.

Referenced by toggle_unit_color().

◆ colored

bool unit::colored

Definition at line 222 of file unit.h.

Referenced by handle_start_phase(), toggle_unit_color(), and unit_virtual_create().

◆ current_form_turn

int unit::current_form_turn

◆ debug

bool unit::debug

Definition at line 234 of file unit.h.

Referenced by dai_auto_settler_run(), debug_command(), and unit_virtual_create().

◆ done_moving

bool unit::done_moving

◆ dying

bool unit::dying

◆ facing

enum direction8 unit::facing

◆ focus_status

enum unit_focus_status unit::focus_status

◆ fuel

int unit::fuel

◆ goto_tile

struct tile* unit::goto_tile

◆ has_orders

bool unit::has_orders

◆ homecity

int unit::homecity

Definition at line 146 of file unit.h.

Referenced by api_edit_create_unit_full(), caravan_evaluate_notransit(), caravan_evaluate_withtransit(), caravan_find_best_destination(), caravan_find_best_destination_notransit(), caravan_find_best_destination_withtransit(), city_packet_common(), city_unit_unhappiness(), client_remove_unit(), cowt_callback(), create_city(), create_present_supported_units_widget_list(), dai_caravan_can_trade_cities_diff_cont(), dai_evaluate_tile_for_air_attack(), dai_find_strategic_airbase(), dai_is_unit_tired_waiting_boat(), dai_manage_caravan(), dai_military_defend(), dai_spend_gold(), dai_unit_make_homecity(), do_capture_units(), do_unit_change_homecity(), do_unit_establish_trade(), do_unit_make_homeless(), edit_buffer_copy(), expl_act_not_enabl(), goto_dialog::fill_tab(), find_something_to_kill(), game_remove_unit(), get_unit_info_label_text2(), get_units_report_data(), gui_refresh_unit_city_dialogs(), handle_edit_unit_create(), handle_unit_packet_common(), map_unit_homecity_enqueue(), middle_supported_unit_release(), package_unit(), place_unit(), player_restore_units(), popup_action_selection(), popup_info_text(), qtg_refresh_unit_city_dialogs(), real_menus_update(), refresh_unit_city_dialogs(), server_remove_unit_full(), sg_load_player_unit(), sg_load_player_unit(), sg_load_player_units(), sg_load_player_units(), sg_save_player_units(), mr_menu::slot_autocaravan(), supported_unit_activate_close_callback(), supported_unit_activate_close_callback(), supported_unit_callback(), supported_unit_callback(), supported_unit_middle_callback(), transfer_city(), transfer_city_units(), transform_unit(), unit_bribe_cost(), unit_can_est_trade_route_here(), unit_change_homecity_handling(), unit_change_owner(), unit_description(), unit_food_upkeep(), unit_gain_hitpoints(), unit_get_goods(), unit_move_consequences(), unit_virtual_create(), unit_virtual_prepare(), units_orders_city_dlg_callback(), units_report_update(), unpackage_unit(), hud_units::update_actions(), units_reports::update_units(), and usdlg_get_unit_descr().

◆ hp

int unit::hp

◆ id

int unit::id

Definition at line 145 of file unit.h.

Referenced by action_auto_perf_unit_do(), action_decision_handle(), action_decision_maybe_auto(), action_selection_refresh(), action_sub_target_id_for_action(), adv_unit_execute_path(), adv_unit_move(), agents_unit_changed(), agents_unit_new(), agents_unit_remove(), api_edit_perform_action_unit_vs_city(), api_edit_perform_action_unit_vs_city_impr(), api_edit_perform_action_unit_vs_city_tech(), api_edit_perform_action_unit_vs_self(), api_edit_perform_action_unit_vs_tile(), api_edit_perform_action_unit_vs_tile_extra(), api_edit_perform_action_unit_vs_unit(), ask_server_for_actions(), auto_settler_setup_work(), caravan_optimize_callback(), cause_a_unit_changed_for_agent(), check_units_single_tile(), city_create_unit(), city_dialog_update_present_units(), city_dialog_update_supported_units(), citymap_turn_init(), client_remove_unit(), create_present_supported_units_widget_list(), create_unit_menu(), current_focus_remove(), cycle_enemy_units(), dai_airlift(), dai_auto_settler_run(), dai_caravan_goto(), dai_diplomat_bribe_nearby(), dai_diplomat_city(), dai_do_build_city(), dai_hunter_manage(), dai_hunter_try_launch(), dai_manage_airunit(), dai_manage_caravan(), dai_manage_military(), dai_manage_paratrooper(), dai_military_attack(), dai_should_we_air_attack_tile(), dai_unit_attack(), dai_unit_make_homecity(), dai_unit_move(), dai_unit_new_task(), dai_upgrade_units(), decrease_unit_hp_smooth(), unit_item::disband(), do_attack(), do_capture_units(), do_disband_alternative(), do_unit_act_sel_vs(), do_unit_paradrop_to(), do_unit_teleport_to(), do_wipe_units(), execute_orders(), expl_act_not_enabl(), find_best_city_placement(), find_something_to_kill(), finish_city(), game_remove_unit(), goto_map_unit(), handle_edit_player_vision(), handle_edit_unit_create(), handle_tile_info(), handle_unit_actions(), handle_unit_get_actions(), handle_unit_orders(), handle_unit_packet_common(), handle_unit_remove(), handle_unit_sscs_set(), handle_unit_type_upgrade(), idex_register_unit(), idex_unregister_unit(), immediate_destination(), key_unit_action_select(), key_unit_assign_battlegroup(), make_path_orders(), move_unit_map_canvas(), non_allied_not_listed_at(), objbind_get_value_from_object(), objbind_pack_current_values(), occupy_move(), package_short_unit(), package_unit(), place_unit(), player_restore_units(), popup_action_selection(), popup_bribe_dialog(), popup_bribe_dialog(), popup_incite_dialog(), popup_incite_dialog(), popup_pillage_dialog(), popup_sabotage_dialog(), popup_sabotage_dialog(), popup_upgrade_dialog(), present_unit_callback(), put_one_tile(), random_movements(), real_bodyguard_log(), real_unit_log(), request_move_unit_direction(), request_new_unit_activity_targeted(), request_orders_cleared(), request_unit_airlift(), request_unit_build_city(), request_unit_caravan_action(), request_unit_change_homecity(), request_unit_disband(), request_unit_non_action_move(), request_unit_ssa_set(), request_unit_upgrade(), select_tgt_extra(), select_tgt_unit(), send_connect_route(), send_path_orders(), server_remove_unit_full(), set_unit_icon(), settler_evaluate_city_requests(), settler_evaluate_improvements(), sg_load_player_unit(), sg_load_player_unit(), sg_load_player_units(), sg_load_player_units(), sg_load_sanitycheck(), sg_load_sanitycheck(), sg_save_player_units(), mr_menu::slot_delayed_goto(), supported_unit_callback(), choice_dialog::switch_target(), texai_unit_destroyed(), texai_unit_info_recv(), texai_unit_move_seen(), texai_unit_update(), text_tag_initv(), text_tag_start_sequence(), tgt_extra_change_callback(), tgt_unit_change_callback(), throw_units_from_illegal_cities(), transfer_city(), transfer_unit(), unit_activity_astr(), unit_activity_handling_targeted(), unit_def_rating(), unit_description(), unit_do_disband_trad(), unit_enter_hut(), unit_food_upkeep(), unit_foodbox_cost(), unit_goes_out_of_sight(), unit_is_virtual(), unit_link(), unit_list_compare(), unit_list_find(), unit_move(), unit_move_consequences(), unit_move_data_get(), unit_move_handling(), unit_select_dialog_popup(), unit_survive_autoattack(), unit_virtual_create(), unpackage_short_unit(), unpackage_unit(), upkeep_kill_unit(), usdlg_get_unit_descr(), and usdlg_tab_append_units().

◆ index

int unit::index

◆ length

int unit::length

◆ list

struct unit_order* unit::list

◆ moved

bool unit::moved

◆ moves_left

int unit::moves_left

Definition at line 150 of file unit.h.

Referenced by action_mp_full_makes_legal(), action_success_pay_mp(), action_success_target_pay_mp(), adv_follow_path(), adv_unit_execute_path(), adv_unit_move(), api_edit_create_unit_full(), auto_settler_setup_work(), auto_settlers_player(), caravan_evaluate_withtransit(), caravan_find_best_destination(), caravan_find_best_destination_withtransit(), caravan_optimize_withtransit(), units_select::create_pixmap(), create_unit(), create_unit_full(), dai_auto_settler_run(), dai_caravan_goto(), dai_diplomat_bribe_nearby(), dai_diplomat_city(), dai_find_strategic_airbase(), dai_gothere(), dai_manage_airunit(), dai_manage_diplomat(), dai_manage_military(), dai_manage_paratrooper(), dai_manage_unit(), dai_military_attack(), dai_military_rampage(), dai_unit_bodyguard_move(), dai_unit_can_strike_my_unit(), dai_unit_goto_constrained(), dai_unit_move(), do_airline(), do_attack(), do_expel_unit(), execute_orders(), fill_unit_sprite_array(), find_best_focus_candidate(), find_nearest_airbase(), find_nearest_unit(), find_rampage_target(), find_something_to_bomb(), get_activity_rate_this_turn(), get_attack_power(), goto_fill_parameter_full(), handle_edit_unit(), handle_unit_orders(), handle_unit_packet_common(), handle_unit_server_side_agent_set(), unit_hud_selector::hp_filter(), manage_auto_explorer(), objbind_get_value_from_object(), objbind_pack_current_values(), occupy_move(), package_unit(), pf_fuel_map_iterate(), pft_fill_unit_default_parameter(), player_is_watching(), player_restore_units(), quickselect(), random_movements(), set_unit_activity_internal(), sg_load_player_unit(), sg_load_player_unit(), sg_save_player_units(), teleport_unit_to_city(), test_unit_can_airlift_to(), transform_unit(), unit_activity_astr(), unit_att_rating_now(), unit_change_owner(), unit_focus_update(), unit_move(), unit_restore_movepoints(), unit_survive_autoattack(), unit_tired_attack_string(), unit_virtual_create(), unit_virtual_prepare(), unpackage_unit(), and hud_units::update_actions().

◆ moving

struct unit_move_data* unit::moving

◆ nationality

struct player* unit::nationality

◆ occupied

bool unit::occupied

◆ ord_city

int unit::ord_city

◆ ord_map

int unit::ord_map

◆ [struct]

struct { ... } unit::orders

◆ owner

struct player* unit::owner

◆ paradropped

bool unit::paradropped

◆ refcount

int unit::refcount

Definition at line 141 of file unit.h.

Referenced by unit_virtual_create(), and unit_virtual_destroy().

◆ removal_callback

void(* unit::removal_callback) (struct unit *punit)

◆ repeat

bool unit::repeat

◆ [struct]

struct { ... } unit::server

◆ ssa_controller

enum server_side_agent unit::ssa_controller

◆ stay

bool unit::stay

◆ tile

struct tile* unit::tile

◆ transported_by

int unit::transported_by

◆ transporter

struct unit* unit::transporter

◆ transporting

struct unit_list* unit::transporting

◆ upkeep

int unit::upkeep[O_LAST]

◆ upkeep_paid

int unit::upkeep_paid[O_LAST]

◆ utype

const struct unit_type* unit::utype

◆ veteran

int unit::veteran

◆ vigilant

bool unit::vigilant

◆ vision

struct vision* unit::vision