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)
234 void *ais[FREECIV_AI_MOD_LAST];
260#define CHECK_UNIT(punit) \
261 (fc_assert(punit != NULL), \
262 fc_assert(unit_type_get(punit) != NULL), \
263 fc_assert(unit_owner(punit) != NULL), \
264 fc_assert(player_by_number(player_index(unit_owner(punit))) \
265 == unit_owner(punit)), \
266 fc_assert(game_unit_by_number(punit->id) != NULL))
268#define CHECK_UNIT(punit)
277#define activity_type_list_iterate(_act_list_, _act_) \
280 for (_act_i_ = 0; _act_list_[_act_i_] != ACTIVITY_LAST; _act_i_++) { \
281 Activity_type_id _act_ = _act_list_[_act_i_];
283#define activity_type_list_iterate_end \
288#define activity_type_iterate(_act_) \
290 activity_type_list_iterate(real_activities, _act_)
292#define activity_type_iterate_end \
293 activity_type_list_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 \
311 const struct action *paction);
317 const struct player *restriction,
319 const struct city *pdest_city);
326 const struct unit *ptrans);
331 const struct unit *pcargo,
332 const struct unit *ptrans);
336 const struct city *pcity);
353 const struct tile *ptile);
356 enum unit_activity new_activity,
362 const struct tile *ptile,
367 const struct tile *ptile);
374 enum action_result result);
376 enum action_sub_result sub_result);
378 const struct player *pplayer,
379 const struct tile *ptile,
bool omniscient);
393#define unit_home(_pu_) (game_city_by_number((_pu_)->homecity))
394#define unit_owner(_pu) ((_pu)->owner)
395#define unit_tile(_pu) ((_pu)->tile)
401 const struct player *pplayer);
407 const struct player *pplayer)
413 const struct player *pplayer);
419 const struct player *pplayer)
425 const struct player *pplayer);
431 const struct player *pplayer)
437 const struct player *pplayer);
443 const struct player *pplayer)
449 const struct player *pplayer);
456 const struct player *pplayer)
462 const struct player *pplayer);
502 const struct tile *ptile);
513 char *buf,
size_t bufsz);
538#define unit_transported_server(_pcargo_) ((_pcargo_)->transporter != NULL)
541#define unit_transported_client(_pcargo_) \
542 ((_pcargo_)->client.transported_by != -1 \
543 || (_pcargo_)->transporter != NULL)
548 const struct unit *ptrans);
556#define unit_transports_iterate(_pcargo, _ptrans) { \
557 struct unit *_ptrans; \
558 for (_ptrans = unit_transport_get(_pcargo); NULL != _ptrans; \
559 _ptrans = unit_transport_get(_ptrans)) {
560#define unit_transports_iterate_end }}
566 const struct unit *ptrans);
567#define unit_cargo_iterate(_ptrans, _pcargo) \
568 generic_iterate(struct cargo_iter, struct unit *, _pcargo, \
569 cargo_iter_sizeof, cargo_iter_init, _ptrans)
570#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_list * transporting
struct unit::@80::@82 client
struct extra_type * changed_from_target
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::@80::@83 server
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)
Activity_type_id real_activities[ACTIVITY_LAST]
bool is_real_activity(enum unit_activity activity)
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_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 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 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[]
void setup_real_activities_array(void)
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_military_unit(const struct unit *punit)
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)
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 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_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)
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 kills_citizen_after_attack(const struct unit *punit)
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)
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)
bool can_unit_alight_or_be_unloaded(const struct civ_map *nmap, const struct unit *pcargo, const struct unit *ptrans)