Freeciv-3.1
|
Go to the source code of this file.
Macros | |
#define | SPECLIST_TAG unit |
#define | SPECLIST_TYPE struct unit |
#define | unit_list_iterate(unitlist, punit) TYPED_LIST_ITERATE(struct unit, unitlist, punit) |
#define | unit_list_iterate_end LIST_ITERATE_END |
#define | unit_list_both_iterate(unitlist, plink, punit) |
#define | unit_list_both_iterate_end LIST_BOTH_ITERATE_END |
#define | unit_list_iterate_safe(unitlist, _unit) |
#define | unit_list_iterate_safe_end |
Functions | |
struct unit * | unit_list_find (const struct unit_list *punitlist, int unit_id) |
void | unit_list_sort_ord_map (struct unit_list *punitlist) |
void | unit_list_sort_ord_city (struct unit_list *punitlist) |
bool | can_units_do (const struct unit_list *punits, bool(can_fn)(const struct unit *punit)) |
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)) |
bool | can_units_do_activity (const struct civ_map *nmap, const struct unit_list *punits, enum unit_activity activity) |
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_any_road (const struct civ_map *nmap, const struct unit_list *punits) |
bool | can_units_do_base_gui (const struct unit_list *punits, enum base_gui_type base_gui) |
bool | units_have_type_flag (const struct unit_list *punits, enum unit_type_flag_id flag, bool has_flag) |
bool | units_contain_cityfounder (const struct unit_list *punits) |
bool | units_can_do_action (const struct unit_list *punits, action_id act_id, bool can_do) |
bool | units_can_do_action_with_result (const struct unit_list *punits, enum action_result result, bool can_do) |
bool | units_are_occupied (const struct unit_list *punits) |
bool | units_can_load (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_can_upgrade (const struct civ_map *nmap, const struct unit_list *punits) |
bool | units_can_convert (const struct civ_map *nmap, const struct unit_list *punits) |
#define SPECLIST_TAG unit |
Definition at line 27 of file unitlist.h.
#define SPECLIST_TYPE struct unit |
Definition at line 28 of file unitlist.h.
#define unit_list_both_iterate | ( | unitlist, | |
plink, | |||
punit | |||
) |
Definition at line 34 of file unitlist.h.
#define unit_list_both_iterate_end LIST_BOTH_ITERATE_END |
Definition at line 37 of file unitlist.h.
#define unit_list_iterate | ( | unitlist, | |
punit | |||
) | TYPED_LIST_ITERATE(struct unit, unitlist, punit) |
Definition at line 31 of file unitlist.h.
#define unit_list_iterate_end LIST_ITERATE_END |
Definition at line 33 of file unitlist.h.
#define unit_list_iterate_safe | ( | unitlist, | |
_unit | |||
) |
Definition at line 39 of file unitlist.h.
#define unit_list_iterate_safe_end |
Definition at line 61 of file unitlist.h.
Return TRUE if the function returns true for any of the units.
Definition at line 95 of file unitlist.c.
Referenced by mr_menu::menus_sensitive(), and real_menus_update().
bool can_units_do_activity | ( | const struct civ_map * | nmap, |
const struct unit_list * | punits, | ||
enum unit_activity | activity | ||
) |
Returns TRUE if any of the units can do the activity.
Definition at line 128 of file unitlist.c.
bool can_units_do_activity_targeted | ( | const struct civ_map * | nmap, |
const struct unit_list * | punits, | ||
enum unit_activity | activity, | ||
struct extra_type * | pextra | ||
) |
Returns TRUE if any of the units can do the targeted activity.
Definition at line 148 of file unitlist.c.
Returns TRUE if any of the units can build any road.
Definition at line 165 of file unitlist.c.
Referenced by mr_menu::menus_sensitive(), and real_menus_update().
bool can_units_do_base_gui | ( | const struct unit_list * | punits, |
enum base_gui_type | base_gui | ||
) |
Returns TRUE if any of the units can build base with given gui_type.
Definition at line 184 of file unitlist.c.
Referenced by mr_menu::menus_sensitive(), and real_menus_update().
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) | |||
) |
Return TRUE if the function returns true for any of the units, on specific map.
Definition at line 111 of file unitlist.c.
Referenced by mr_menu::menus_sensitive(), and real_menus_update().
struct unit * unit_list_find | ( | const struct unit_list * | punitlist, |
int | unit_id | ||
) |
Look for a unit with the given ID in the unit list. Returns NULL if none is found.
Definition at line 30 of file unitlist.c.
Referenced by dai_manage_military(), mr_menu::find_last_unit_pos(), sha_unit_change(), sha_unit_recall(), sha_unit_remove(), and mr_menu::slot_execute_orders().
void unit_list_sort_ord_city | ( | struct unit_list * | punitlist | ) |
Sorts the unit list by punit->server.ord_city values.
Only used in server/savegame/savegame[23].c.
Definition at line 85 of file unitlist.c.
Referenced by unit_ordering_apply(), and unit_ordering_apply().
void unit_list_sort_ord_map | ( | struct unit_list * | punitlist | ) |
Sorts the unit list by punit->server.ord_map values.
Only used in server/savegame/savegame[23].c.
Definition at line 73 of file unitlist.c.
Referenced by unit_ordering_apply(), and unit_ordering_apply().
bool units_are_occupied | ( | const struct unit_list * | punits | ) |
Return TRUE iff any of the units is a transporter that is occupied.
Definition at line 277 of file unitlist.c.
Referenced by unit_item::create_actions(), mr_menu::menus_sensitive(), and real_menus_update().
Return TRUE iff any of the units can convert to another unit type
Definition at line 353 of file unitlist.c.
Referenced by mr_menu::menus_sensitive(), and real_menus_update().
If has_flag is true, returns true iff any of the units are able to do the specified action.
If has_flag is false, returns true iff any of the units are unable do the specified action.
Definition at line 243 of file unitlist.c.
Referenced by mr_menu::menus_sensitive(), real_menus_update(), and go_act_menu::update().
bool units_can_do_action_with_result | ( | const struct unit_list * | punits, |
enum action_result | result, | ||
bool | can_do | ||
) |
If has_flag is true, returns true iff any of the units are able to do any action with the specified result.
If has_flag is false, returns true iff any of the units are unable do any action with the specified result.
Definition at line 262 of file unitlist.c.
Referenced by mr_menu::menus_sensitive().
bool units_can_load | ( | const struct unit_list * | punits | ) |
Returns TRUE iff any of these units can load.
Definition at line 291 of file unitlist.c.
Referenced by unit_item::create_actions(), mr_menu::menus_sensitive(), and real_menus_update().
bool units_can_unload | ( | const struct unit_list * | punits | ) |
Return TRUE iff any of these units can unload.
Definition at line 305 of file unitlist.c.
Referenced by unit_item::create_actions(), mr_menu::menus_sensitive(), and real_menus_update().
Return TRUE iff any of the units can be upgraded to another unit type (for money)
Definition at line 338 of file unitlist.c.
Referenced by unit_item::create_actions(), mr_menu::menus_sensitive(), and real_menus_update().
bool units_contain_cityfounder | ( | const struct unit_list * | punits | ) |
Does the list contain any cityfounder units
Definition at line 221 of file unitlist.c.
Referenced by mr_menu::menus_sensitive().
bool units_have_activity_on_tile | ( | const struct unit_list * | punits, |
enum unit_activity | activity | ||
) |
Return TRUE iff any of the units' tiles have the activity running on them.
Definition at line 322 of file unitlist.c.
Referenced by mr_menu::menus_sensitive(), and real_menus_update().
bool units_have_type_flag | ( | const struct unit_list * | punits, |
enum unit_type_flag_id | flag, | ||
bool | has_flag | ||
) |
If has_flag is true, returns true iff any of the units have the flag.
If has_flag is false, returns true iff any of the units don't have the flag.
Definition at line 206 of file unitlist.c.
Referenced by mr_menu::menus_sensitive(), and real_menus_update().