17 #define MAX_NUM_TEAM_SLOTS MAX_NUM_PLAYER_SLOTS
42 const char *team_name);
62 #define team_slots_iterate(_tslot) \
63 if (team_slots_initialised()) { \
64 struct team_slot *_tslot = team_slot_first(); \
65 for (; nullptr != _tslot; _tslot = team_slot_next(_tslot)) {
66 #define team_slots_iterate_end \
71 #define teams_iterate(_pteam) \
72 team_slots_iterate(_tslot) \
74 struct team *_pteam = team_slot_get_team(_tslot); \
75 if (_pteam != nullptr) {
76 #define teams_iterate_end \
79 team_slots_iterate_end;
int team_index(const struct team *pteam)
Return the team index.
struct team * team_by_number(const int team_id)
Return struct team pointer for the given team index.
struct team_slot * team_slot_next(struct team_slot *tslot)
Returns the next team slot.
const char * team_name_translation(const struct team *pteam)
Returns the name (translated) of the team.
const char * team_rule_name(const struct team *pteam)
Returns the name (untranslated) of the team.
void team_add_player(struct player *pplayer, struct team *pteam)
Set a player to a team.
struct team_slot * team_slot_first()
Returns the first team slot.
const char * team_slot_defined_name(const struct team_slot *tslot)
Returns the name defined in the ruleset for this slot.
int team_count()
Return the current number of teams.
struct team * team_slot_get_team(const struct team_slot *tslot)
Returns the team corresponding to the slot.
int team_pretty_name(const struct team *pteam, QString &buf)
Set in 'buf' the name of the team 'pteam' in a format like "team <team_name>".
const char * team_slot_name_translation(const struct team_slot *tslot)
Returns the name (translated) of the slot.
int team_number(const struct team *pteam)
Return the team index/number/id.
void team_destroy(struct team *pteam)
Destroys a team.
void team_slots_init()
Initialise all team slots.
const char * team_slot_rule_name(const struct team_slot *tslot)
Returns the name (untranslated) of the slot.
bool team_slots_initialised()
Returns TRUE if the team slots have been initialized.
const struct player_list * team_members(const struct team *pteam)
Returns the member list of the team.
void team_slots_free()
Remove all team slots.
int team_slot_index(const struct team_slot *tslot)
Returns the index of the team slots.
struct team * team_new(struct team_slot *tslot)
Creates a new team for the slot.
void team_remove_player(struct player *pplayer)
Remove the player from the team.
int team_slot_count()
Returns the total number of team slots (including used slots).
struct team_slot * team_slot_by_rule_name(const char *team_name)
Does a linear search for a (defined) team name.
struct team_slot * team_slot_by_number(int team_id)
Return the possibly unused and uninitialized team slot.
bool team_slot_is_used(const struct team_slot *tslot)
Returns TRUE is this slot is "used" i.e.
void team_slot_set_defined_name(struct team_slot *tslot, const char *team_name)
Set the name defined in the ruleset for this slot.