16 int transport_depth(
const unit *
unit)
30 bool units_sort(
const unit *lhs,
const unit *rhs)
45 int lhs_depth = transport_depth(lhs);
46 int rhs_depth = transport_depth(rhs);
47 if (lhs_depth > rhs_depth) {
49 }
else if (lhs_depth < rhs_depth) {
59 if (lhs_def != rhs_def) {
60 return lhs_def > rhs_def;
79 return lhs->
id < rhs->
id;
87 std::vector<unit *>
sorted(
const unit_list *units)
89 std::vector<unit *> vec;
93 std::sort(vec.begin(), vec.end(), units_sort);
std::vector< unit * > sorted(const unit_list *units)
Returns a version of units sorted in the way the user would like to see them.
int player_index(const struct player *pplayer)
Return the player index.
struct player * nationality
struct unit * transporter
const struct unit_type * utype
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end