106#define SPECENUM_NAME unit_ss_data_type
109#define SPECENUM_VALUE0 USSDT_QUEUE
112#define SPECENUM_VALUE1 USSDT_UNQUEUE
115#define SPECENUM_VALUE2 USSDT_BATTLE_GROUP
121#define SPECENUM_VALUE3 USSDT_SENTRY
125#define SPECENUM_NAME server_side_agent
126#define SPECENUM_VALUE0 SSA_NONE
127#define SPECENUM_VALUE0NAME N_("?serveragent:None")
128#define SPECENUM_VALUE1 SSA_AUTOSETTLER
129#define SPECENUM_VALUE1NAME N_("Autosettlers")
130#define SPECENUM_VALUE2 SSA_AUTOEXPLORE
131#define SPECENUM_VALUE2NAME N_("Autoexplore")
132#define SPECENUM_COUNT SSA_COUNT
189#define MAX_NUM_BATTLEGROUPS (4)
190#define BATTLEGROUP_NONE (-1)
262#define CHECK_UNIT(punit) \
263 (fc_assert(punit != NULL), \
264 fc_assert(unit_type_get(punit) != NULL), \
265 fc_assert(unit_owner(punit) != NULL), \
266 fc_assert(player_by_number(player_index(unit_owner(punit))) \
267 == unit_owner(punit)), \
268 fc_assert(game_unit_by_number(punit->id) != NULL))
270#define CHECK_UNIT(punit)
273#define activity_type_list_iterate(_act_list_, _act_) \
276 for (_act_i_ = 0; _act_list_[_act_i_] != ACTIVITY_LAST; _act_i_++) { \
277 Activity_type_id _act_ = _act_list_[_act_i_];
279#define activity_type_list_iterate_end \
284#define activity_type_iterate(_act_) \
286 Activity_type_id _act_; \
287 for (_act_ = 0; _act_ != ACTIVITY_LAST; _act_++) { \
289#define activity_type_iterate_end \
295#define tile_changing_activities_iterate(_act_) \
297 activity_type_list_iterate(tile_changing_activities, _act_)
299#define tile_changing_activities_iterate_end \
300 activity_type_list_iterate_end \
334 const struct city *pcity);
351 const struct tile *ptile);
360 const struct tile *ptile,
365 const struct tile *ptile);
380 const struct player *pplayer,
381 const struct tile *ptile,
bool omniscient);
394#define unit_home(_pu_) (game_city_by_number((_pu_)->homecity))
395#define is_unit_homeless(_pu_) (punit->homecity == IDENTITY_NUMBER_ZERO)
396#define unit_owner(_pu) ((_pu)->owner)
397#define unit_tile(_pu) ((_pu)->tile)
403 const struct player *pplayer);
409 const struct player *pplayer)
415 const struct player *pplayer);
421 const struct player *pplayer)
427 const struct player *pplayer);
433 const struct player *pplayer)
439 const struct player *pplayer);
445 const struct player *pplayer)
451 const struct player *pplayer);
458 const struct player *pplayer)
464 const struct player *pplayer);
505 const struct tile *ptile);
541#define unit_transported_server(_pcargo_) ((_pcargo_)->transporter != NULL)
544#define unit_transported_client(_pcargo_) \
545 ((_pcargo_)->client.transported_by != -1 \
546 || (_pcargo_)->transporter != NULL)
559#define unit_transports_iterate(_pcargo, _ptrans) { \
560 struct unit *_ptrans; \
561 for (_ptrans = unit_transport_get(_pcargo); NULL != _ptrans; \
562 _ptrans = unit_transport_get(_ptrans)) {
563#define unit_transports_iterate_end }}
570#define unit_cargo_iterate(_ptrans, _pcargo) \
571 generic_iterate(struct cargo_iter, struct unit *, _pcargo, \
572 cargo_iter_sizeof, cargo_iter_init, _ptrans)
573#define unit_cargo_iterate_end generic_iterate_end
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
static bool is_server(void)
enum unit_activity Activity_type_id
enum unit_activity activity
enum action_decision action_decision_want
enum unit_activity activity
struct unit::@81::@83 client
struct unit_list * transporting
struct extra_type * changed_from_target
struct unit::@81::@84 server
struct extra_type * activity_target
struct act_prob * act_prob_cache
enum unit_activity changed_from
struct player * nationality
struct unit_move_data * moving
struct unit * transporter
struct goods_type * carrying
struct tile * action_decision_tile
const struct unit_type * utype
enum unit_focus_status focus_status
enum server_side_agent ssa_controller
size_t cargo_iter_sizeof(void) fc__attribute((const))
bool unit_can_do_action_sub_result(const struct unit *punit, enum action_sub_result sub_result)
static bool is_other_players_unit_tile(const struct tile *ptile, const struct player *pplayer)
bool can_unit_do_activity_targeted_at(const struct civ_map *nmap, const struct unit *punit, enum unit_activity activity, struct extra_type *target, const struct tile *ptile)
bool is_tile_activity(enum unit_activity activity)
struct unit_order * create_unit_orders(const struct civ_map *nmap, int length, const struct unit_order *orders)
enum unit_upgrade_result unit_transform_result(const struct civ_map *nmap, const struct unit *punit, const struct unit_type *to_unittype)
bool unit_type_really_ignores_zoc(const struct unit_type *punittype)
bool unit_type_is_losing_hp(const struct player *pplayer, const struct unit_type *punittype)
bool is_terrain_change_activity(enum unit_activity activity)
struct unit * tile_non_allied_unit(const struct tile *ptile, const struct player *pplayer)
int unit_shield_value(const struct unit *punit, const struct unit_type *punittype, const struct action *paction)
int get_transporter_occupancy(const struct unit *ptrans)
bool can_unit_change_homecity_to(const struct civ_map *nmap, const struct unit *punit, const struct city *pcity)
void free_unit_orders(struct unit *punit)
void unit_set_ai_data(struct unit *punit, const struct ai_type *ai, void *data)
bool unit_is_alive(int id)
bool unit_can_est_trade_route_here(const struct unit *punit)
bool is_occupying_unit(const struct unit *punit)
bool is_hiding_unit(const struct unit *punit)
int get_activity_rate_this_turn(const struct unit *punit)
int unit_pays_mp_for_action(const struct action *paction, const struct unit *punit)
int get_turns_for_activity_at(const struct unit *punit, enum unit_activity activity, const struct tile *ptile, struct extra_type *tgt)
static bool is_enemy_unit_tile(const struct tile *ptile, const struct player *pplayer)
bool unit_transport_load(struct unit *pcargo, struct unit *ptrans, bool force)
struct unit * transporter_for_unit_at(const struct unit *pcargo, const struct tile *ptile)
struct iterator * cargo_iter_init(struct cargo_iter *iter, const struct unit *ptrans)
int unit_cargo_depth(const struct unit *pcargo)
static bool is_non_attack_unit_tile(const struct tile *ptile, const struct player *pplayer)
enum unit_upgrade_result unit_upgrade_info(const struct civ_map *nmap, const struct unit *punit, char *buf, size_t bufsz)
void set_unit_activity(struct unit *punit, enum unit_activity new_activity)
bool is_losing_hp(const struct unit *punit)
bool is_targeted_activity(enum unit_activity activity)
bool unit_can_add_or_build_city(const struct civ_map *nmap, const struct unit *punit)
struct unit * tile_non_attack_unit(const struct tile *ptile, const struct player *pplayer)
int hp_gain_coord(const struct unit *punit)
bool can_unit_change_homecity(const struct civ_map *nmap, const struct unit *punit)
bool is_plr_zoc_client(const struct player *unit_owner, const struct tile *ptile, const struct civ_map *zmap)
struct player * unit_nationality(const struct unit *punit)
bool unit_being_aggressive(const struct civ_map *nmap, const struct unit *punit)
int get_activity_rate(const struct unit *punit)
bool can_unit_deboard_or_be_unloaded(const struct civ_map *nmap, const struct unit *pcargo, const struct unit *ptrans)
bool unit_transport_check(const struct unit *pcargo, const struct unit *ptrans)
bool is_attack_unit(const struct unit *punit)
static bool is_allied_unit_tile(const struct tile *ptile, const struct player *pplayer)
const Activity_type_id tile_changing_activities[]
struct unit * unit_transport_get(const struct unit *pcargo)
bool unit_transport_unload(struct unit *pcargo)
bool is_build_activity(enum unit_activity activity)
bool unit_contained_in(const struct unit *pcargo, const struct unit *ptrans)
int unit_gain_hitpoints(const struct unit *punit)
enum unit_airlift_result test_unit_can_airlift_to(const struct civ_map *nmap, const struct player *restriction, const struct unit *punit, const struct city *pdest_city)
bool is_plr_zoc_srv(const struct player *unit_owner, const struct tile *ptile, const struct civ_map *zmap)
bool can_unit_continue_current_activity(const struct civ_map *nmap, struct unit *punit)
int unit_bribe_cost(struct unit *punit, struct player *briber)
void unit_upkeep_astr(const struct unit *punit, struct astring *astr)
bool could_unit_load(const struct unit *pcargo, const struct unit *ptrans)
bool unit_is_cityfounder(const struct unit *punit)
bool is_unit_activity_on_tile(enum unit_activity activity, const struct tile *ptile)
bool can_unit_do_autosettlers(const struct unit *punit)
@ UU_UNSUITABLE_TRANSPORT
bool is_field_unit(const struct unit *punit)
bool unit_can_do_action(const struct unit *punit, const action_id act_id)
bool unit_can_do_action_result(const struct unit *punit, enum action_result result)
bool is_martial_law_unit(const struct unit *punit)
void set_unit_activity_targeted(struct unit *punit, enum unit_activity new_activity, struct extra_type *new_target)
struct unit * unit_virtual_create(struct player *pplayer, struct city *pcity, const struct unit_type *punittype, int veteran_level)
bool can_unit_teleport(const struct civ_map *nmap, const struct unit *punit)
bool unit_order_list_is_sane(const struct civ_map *nmap, int length, const struct unit_order *orders)
const char * get_activity_text(enum unit_activity activity)
bv_extras get_unit_tile_pillage_set(const struct tile *ptile)
int get_transporter_capacity(const struct unit *punit)
bool can_unit_unload(const struct unit *punit, const struct unit *ptrans)
bool is_enter_borders_unit(const struct unit *punit)
bool is_clean_activity(enum unit_activity activity)
int unit_transport_depth(const struct unit *ptrans)
bool can_unit_paradrop(const struct civ_map *nmap, const struct unit *punit)
void unit_activity_astr(const struct unit *punit, struct astring *astr)
bool unit_can_help_build_wonder_here(const struct civ_map *nmap, const struct unit *punit)
bool can_unit_do_activity(const struct civ_map *nmap, const struct unit *punit, enum unit_activity activity)
struct unit * tile_other_players_unit(const struct tile *ptile, const struct player *pplayer)
bool is_special_unit(const struct unit *punit)
void unit_virtual_destroy(struct unit *punit)
struct unit * tile_enemy_unit(const struct tile *ptile, const struct player *pplayer)
void unit_tile_set(struct unit *punit, struct tile *ptile)
enum unit_upgrade_result unit_upgrade_test(const struct civ_map *nmap, const struct unit *punit, bool is_free)
bool unit_can_airlift_to(const struct civ_map *nmap, const struct unit *punit, const struct city *pcity) fc__attribute((nonnull(3)))
bool can_unit_load(const struct unit *punit, const struct unit *ptrans)
bool unit_transported(const struct unit *pcargo)
bool are_unit_orders_equal(const struct unit_order *order1, const struct unit_order *order2)
bool unit_is_virtual(const struct unit *punit)
bool is_square_threatened(const struct civ_map *nmap, const struct player *pplayer, const struct tile *ptile, bool omniscient)
bool is_guard_unit(const struct unit *punit)
struct unit * unit_occupies_tile(const struct tile *ptile, const struct player *pplayer)
struct unit_list * unit_transport_cargo(const struct unit *ptrans)
void * unit_ai_data(const struct unit *punit, const struct ai_type *ai)
bool unit_has_orders(const struct unit *punit)
struct unit * tile_allied_unit(const struct tile *ptile, const struct player *pplayer)
struct unit * transporter_for_unit(const struct unit *pcargo)
static bool is_non_allied_unit_tile(const struct tile *ptile, const struct player *pplayer)
static bool is_my_zoc(const struct player *unit_owner, const struct tile *ptile, const struct civ_map *zmap)
bool unit_can_convert(const struct civ_map *nmap, const struct unit *punit)
bool activity_requires_target(enum unit_activity activity)
bool could_unit_be_in_transport(const struct unit *pcargo, const struct unit *ptrans)
bool can_unit_do_activity_targeted(const struct civ_map *nmap, const struct unit *punit, enum unit_activity activity, struct extra_type *target)