108#define SPECENUM_NAME unit_ss_data_type
111#define SPECENUM_VALUE0 USSDT_QUEUE
114#define SPECENUM_VALUE1 USSDT_UNQUEUE
117#define SPECENUM_VALUE2 USSDT_BATTLE_GROUP
123#define SPECENUM_VALUE3 USSDT_SENTRY
127#define SPECENUM_NAME server_side_agent
128#define SPECENUM_VALUE0 SSA_NONE
129#define SPECENUM_VALUE0NAME N_("?serveragent:None")
130#define SPECENUM_VALUE1 SSA_AUTOWORKER
131#define SPECENUM_VALUE1NAME N_("AutoWorker")
132#define SPECENUM_VALUE2 SSA_AUTOEXPLORE
133#define SPECENUM_VALUE2NAME N_("Autoexplore")
134#define SPECENUM_COUNT SSA_COUNT
192#define MAX_NUM_BATTLEGROUPS (4)
193#define BATTLEGROUP_NONE (-1)
265#define CHECK_UNIT(punit) \
266 (fc_assert(punit != NULL), \
267 fc_assert(unit_type_get(punit) != NULL), \
268 fc_assert(unit_owner(punit) != NULL), \
269 fc_assert(player_by_number(player_index(unit_owner(punit))) \
270 == unit_owner(punit)), \
271 fc_assert(game_unit_by_number(punit->id) != NULL))
273#define CHECK_UNIT(punit)
276#define activity_type_list_iterate(_act_list_, _act_) \
279 for (_act_i_ = 0; _act_list_[_act_i_] != ACTIVITY_LAST; _act_i_++) { \
280 Activity_type_id _act_ = _act_list_[_act_i_];
282#define activity_type_list_iterate_end \
287#define activity_type_iterate(_act_) \
289 Activity_type_id _act_; \
290 for (_act_ = 0; _act_ != ACTIVITY_LAST; _act_++) { \
292#define activity_type_iterate_end \
298#define tile_changing_activities_iterate(_act_) \
300 activity_type_list_iterate(tile_changing_activities, _act_)
302#define tile_changing_activities_iterate_end \
303 activity_type_list_iterate_end \
354 const struct tile *ptile);
365 const struct tile *ptile,
370 const struct tile *ptile);
379 const struct player *pplayer);
387 const struct player *pplayer,
401#define unit_home(_pu_) (game_city_by_number((_pu_)->homecity))
402#define is_unit_homeless(_pu_) (punit->homecity == IDENTITY_NUMBER_ZERO)
403#define unit_owner(_pu) ((_pu)->owner)
404#define unit_tile(_pu) ((_pu)->tile)
410 const struct player *pplayer);
416 const struct player *pplayer)
422 const struct player *pplayer);
428 const struct player *pplayer)
434 const struct player *pplayer,
441 const struct player *pplayer,
448 const struct player *pplayer);
454 const struct player *pplayer)
460 const struct player *pplayer);
467 const struct player *pplayer)
473 const struct player *pplayer);
514 const struct tile *ptile);
553#define unit_transported_server(_pcargo_) ((_pcargo_)->transporter != NULL)
556#define unit_transported_client(_pcargo_) \
557 ((_pcargo_)->client.transported_by != -1 \
558 || (_pcargo_)->transporter != NULL)
571#define unit_transports_iterate(_pcargo, _ptrans) { \
572 struct unit *_ptrans; \
573 for (_ptrans = unit_transport_get(_pcargo); NULL != _ptrans; \
574 _ptrans = unit_transport_get(_ptrans)) {
575#define unit_transports_iterate_end }}
582#define unit_cargo_iterate(_ptrans, _pcargo) \
583 generic_iterate(struct cargo_iter, struct unit *, _pcargo, \
584 cargo_iter_sizeof, cargo_iter_init, _ptrans)
585#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
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 int const struct action *paction struct unit struct city * pcity
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_list * transporting
struct extra_type * changed_from_target
struct unit::@84::@87 server
struct unit::@84::@86 client
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)
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)
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)
int unit_bribe_cost(const struct unit *punit, const struct player *briber, const struct unit *briber_unit)
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)
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)
@ 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)
enum gen_action activity_default_action(enum unit_activity act)
bool is_martial_law_unit(const struct unit *punit)
struct unit * unit_virtual_create(struct player *pplayer, struct city *pcity, const struct unit_type *punittype, int veteran_level)
bool can_unit_do_autoworker(const struct unit *punit)
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)
void set_unit_activity_targeted(struct unit *punit, enum unit_activity new_activity, struct extra_type *new_target, enum gen_action trigger_action)
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)
int stack_bribe_cost(const struct tile *ptile, const struct player *briber, const struct unit *briber_unit)
struct unit * tile_enemy_unit(const struct tile *ptile, const struct player *pplayer)
void unit_tile_set(struct unit *punit, struct tile *ptile)
void set_unit_activity(struct unit *punit, enum unit_activity new_activity, enum gen_action trigger_action)
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_flagless_to_player(const struct unit *punit, const struct player *pplayer)
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_my_zoc(const struct player *unit_owner, const struct tile *ptile, const struct civ_map *zmap)
static bool is_non_allied_unit_tile(const struct tile *ptile, const struct player *pplayer, bool everyone_non_allied)
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)
struct unit * tile_non_allied_unit(const struct tile *ptile, const struct player *pplayer, bool everyone_non_allied)
bool can_unit_do_activity_targeted(const struct civ_map *nmap, const struct unit *punit, enum unit_activity activity, struct extra_type *target)