27#define SPECLIST_TAG unit
28#define SPECLIST_TYPE struct unit
31#define unit_list_iterate(unitlist, punit) \
32 TYPED_LIST_ITERATE(struct unit, unitlist, punit)
33#define unit_list_iterate_end LIST_ITERATE_END
34#define unit_list_both_iterate(unitlist, plink, punit) \
35 TYPED_LIST_BOTH_ITERATE(struct unit_list_link, struct unit, unitlist, \
37#define unit_list_both_iterate_end LIST_BOTH_ITERATE_END
39#define unit_list_iterate_safe(unitlist, _unit) \
41 struct unit_list *_unit##_ul = unitlist; \
42 int _unit##_size = unit_list_size(_unit##_ul); \
44 if (_unit##_size > 0) { \
45 int _unit##_numbers[_unit##_size]; \
49 unit_list_iterate(_unit##_ul, _unit) { \
50 _unit##_numbers[_unit##_size++] = _unit->id; \
51 } unit_list_iterate_end; \
53 for (_unit##_index = 0; \
54 _unit##_index < _unit##_size; \
56 struct unit *_unit = \
57 game_unit_by_number(_unit##_numbers[_unit##_index]); \
61#define unit_list_iterate_safe_end \
75 const struct unit_list *
punits,
79 const struct unit_list *
punits,
82 const struct unit_list *
punits,
86 const struct unit_list *
punits);
104 const struct unit_list *
punits);
106 const struct unit_list *
punits);
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
enum unit_activity activity
bool units_can_convert(const struct civ_map *nmap, const struct unit_list *punits)
bool units_are_occupied(const struct unit_list *punits)
bool units_can_do_action_with_result(const struct unit_list *punits, enum action_result result, bool can_do)
bool can_units_do_base_gui(const struct unit_list *punits, enum base_gui_type base_gui)
bool units_contain_cityfounder(const struct unit_list *punits)
void unit_list_sort_ord_map(struct unit_list *punitlist)
bool can_units_do_any_road(const struct civ_map *nmap, const struct unit_list *punits)
bool can_units_do_activity(const struct civ_map *nmap, const struct unit_list *punits, enum unit_activity activity)
struct unit * unit_list_find(const struct unit_list *punitlist, int unit_id)
bool units_can_upgrade(const struct civ_map *nmap, const struct unit_list *punits)
bool units_can_unload(const struct unit_list *punits)
bool units_have_activity_on_tile(const struct unit_list *punits, enum unit_activity activity)
bool units_have_type_flag(const struct unit_list *punits, enum unit_type_flag_id flag, bool has_flag)
bool can_units_do(const struct unit_list *punits, bool(can_fn)(const struct unit *punit))
bool units_can_do_action(const struct unit_list *punits, action_id act_id, bool can_do)
bool units_can_load(const struct unit_list *punits)
void unit_list_sort_ord_city(struct unit_list *punitlist)
bool can_units_do_activity_targeted(const struct civ_map *nmap, const struct unit_list *punits, enum unit_activity activity, struct extra_type *pextra)
bool can_units_do_on_map(const struct civ_map *nmap, const struct unit_list *punits, bool(can_fn)(const struct civ_map *nmap, const struct unit *punit))