![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
Include dependency graph for unitlist.cpp:Go to the source code of this file.
Functions | |
| 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. More... | |
| static int | compar_unit_ord_map (const struct unit *const *ua, const struct unit *const *ub) |
| Comparison function for unit_list_sort, sorting by ord_map: The indirection is a bit gory: Read from the right: More... | |
| static int | compar_unit_ord_city (const struct unit *const *ua, const struct unit *const *ub) |
| Comparison function for unit_list_sort, sorting by ord_city: see above. More... | |
| void | unit_list_sort_ord_map (struct unit_list *punitlist) |
| Sorts the unit list by punit->server.ord_map values. More... | |
| void | unit_list_sort_ord_city (struct unit_list *punitlist) |
| Sorts the unit list by punit->server.ord_city values. More... | |
| bool | can_units_do (const std::vector< unit * > &units, bool(can_fn)(const struct unit *punit)) |
| Return TRUE if the function returns true for any of the units. More... | |
| bool | can_units_do_activity (const std::vector< unit * > &units, enum unit_activity activity) |
| Returns TRUE if any of the units can do the activity. More... | |
| bool | can_units_do_activity_targeted (const std::vector< unit * > &units, enum unit_activity activity, struct extra_type *pextra) |
| Returns TRUE if any of the units can do the targeted activity. More... | |
| bool | can_units_do_any_road (const std::vector< unit * > &units) |
| Returns TRUE if any of the units can build any road. More... | |
| bool | can_units_do_base_gui (const std::vector< unit * > &units, enum base_gui_type base_gui) |
| Returns TRUE if any of the units can build base with given gui_type. More... | |
| bool | units_have_type_flag (const std::vector< unit * > &units, enum unit_type_flag_id flag, bool has_flag) |
| If has_flag is true, returns true iff any of the units have the flag. More... | |
| bool | units_contain_cityfounder (const std::vector< unit * > &units) |
| Does the list contain any cityfounder units. More... | |
| bool | units_can_do_action (const std::vector< unit * > &units, action_id act_id, bool can_do) |
| If has_flag is true, returns true iff any of the units are able to do the specified action. More... | |
| bool | units_are_occupied (const std::vector< unit * > &units) |
| Return TRUE iff any of the units is a transporter that is occupied. More... | |
| bool | units_can_load (const std::vector< unit * > &units) |
| Returns TRUE iff any of these units can load. More... | |
| bool | units_can_unload (const std::vector< unit * > &units) |
| Return TRUE iff any of these units can unload. More... | |
| bool | units_have_activity_on_tile (const std::vector< unit * > &units, enum unit_activity activity) |
| Return TRUE iff any of the units' tiles have the activity running on them. More... | |
| bool | units_can_upgrade (const std::vector< unit * > &units) |
| Return TRUE iff any of the units can be upgraded to another unit type (for money) More... | |
| bool | units_can_convert (const std::vector< unit * > &units) |
| Return TRUE iff any of the units can convert to another unit type. More... | |
| bool | any_unit_in_city (const std::vector< unit * > &units) |
| bool | units_on_the_same_tile (const std::vector< unit * > &units) |
| bool any_unit_in_city | ( | const std::vector< unit * > & | units | ) |
Definition at line 321 of file unitlist.cpp.
Referenced by mr_menu::menus_sensitive().
Return TRUE if the function returns true for any of the units.
Definition at line 89 of file unitlist.cpp.
Referenced by mr_menu::menus_sensitive().
| bool can_units_do_activity | ( | const std::vector< unit * > & | units, |
| enum unit_activity | activity | ||
| ) |
Returns TRUE if any of the units can do the activity.
Definition at line 104 of file unitlist.cpp.
Referenced by freeciv::add_quick_unit_actions(), and mr_menu::menus_sensitive().
| bool can_units_do_activity_targeted | ( | const std::vector< unit * > & | units, |
| enum unit_activity | activity, | ||
| struct extra_type * | pextra | ||
| ) |
Returns TRUE if any of the units can do the targeted activity.
Definition at line 123 of file unitlist.cpp.
Referenced by mr_menu::update_bases_menu(), and mr_menu::update_roads_menu().
| bool can_units_do_any_road | ( | const std::vector< unit * > & | units | ) |
Returns TRUE if any of the units can build any road.
Definition at line 139 of file unitlist.cpp.
Referenced by mr_menu::menus_sensitive().
| bool can_units_do_base_gui | ( | const std::vector< unit * > & | units, |
| enum base_gui_type | base_gui | ||
| ) |
Returns TRUE if any of the units can build base with given gui_type.
Definition at line 159 of file unitlist.cpp.
Referenced by mr_menu::menus_sensitive().
|
static |
Comparison function for unit_list_sort, sorting by ord_city: see above.
Only used in server/savegame.c.
Definition at line 58 of file unitlist.cpp.
Referenced by unit_list_sort_ord_city().
|
static |
Comparison function for unit_list_sort, sorting by ord_map: The indirection is a bit gory: Read from the right:
Only used in server/savegame.c.
Definition at line 47 of file unitlist.cpp.
Referenced by unit_list_sort_ord_map().
| 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 nullptr if none is found.
Definition at line 24 of file unitlist.cpp.
Referenced by dai_manage_military(), mr_menu::find_last_unit_pos(), 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.c.
Definition at line 80 of file unitlist.cpp.
Referenced by 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.c.
Definition at line 69 of file unitlist.cpp.
Referenced by unit_ordering_apply().
| bool units_are_occupied | ( | const std::vector< unit * > & | units | ) |
Return TRUE iff any of the units is a transporter that is occupied.
Definition at line 233 of file unitlist.cpp.
Referenced by freeciv::add_quick_unit_actions(), and mr_menu::menus_sensitive().
| bool units_can_convert | ( | const std::vector< unit * > & | units | ) |
Return TRUE iff any of the units can convert to another unit type.
Definition at line 308 of file unitlist.cpp.
Referenced by mr_menu::menus_sensitive().
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 218 of file unitlist.cpp.
Referenced by freeciv::add_quick_unit_actions(), mr_menu::menus_sensitive(), and go_act_menu::update().
| bool units_can_load | ( | const std::vector< unit * > & | units | ) |
Returns TRUE iff any of these units can load.
Definition at line 247 of file unitlist.cpp.
Referenced by freeciv::add_quick_unit_actions(), and mr_menu::menus_sensitive().
| bool units_can_unload | ( | const std::vector< unit * > & | units | ) |
Return TRUE iff any of these units can unload.
Definition at line 261 of file unitlist.cpp.
Referenced by freeciv::add_quick_unit_actions(), and mr_menu::menus_sensitive().
| bool units_can_upgrade | ( | const std::vector< unit * > & | units | ) |
Return TRUE iff any of the units can be upgraded to another unit type (for money)
Definition at line 294 of file unitlist.cpp.
Referenced by freeciv::add_quick_unit_actions(), and mr_menu::menus_sensitive().
| bool units_contain_cityfounder | ( | const std::vector< unit * > & | units | ) |
Does the list contain any cityfounder units.
Definition at line 196 of file unitlist.cpp.
Referenced by mr_menu::menus_sensitive().
| bool units_have_activity_on_tile | ( | const std::vector< unit * > & | units, |
| enum unit_activity | activity | ||
| ) |
Return TRUE iff any of the units' tiles have the activity running on them.
Definition at line 278 of file unitlist.cpp.
Referenced by mr_menu::menus_sensitive().
| bool units_have_type_flag | ( | const std::vector< unit * > & | units, |
| 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 181 of file unitlist.cpp.
Referenced by mr_menu::menus_sensitive().
| bool units_on_the_same_tile | ( | const std::vector< unit * > & | units | ) |
Definition at line 332 of file unitlist.cpp.
Referenced by mr_menu::menus_sensitive().