35#ifdef FREECIV_ENABLE_NLS
67#ifdef FREECIV_ENABLE_NLS
68 tslot->name_translation = NULL;
88 if (NULL != tslot->team) {
91 if (NULL != tslot->defined_name) {
92 free(tslot->defined_name);
94 if (NULL != tslot->rule_name) {
95 free(tslot->rule_name);
97#ifdef FREECIV_ENABLE_NLS
98 if (NULL != tslot->name_translation) {
99 free(tslot->name_translation);
169 return NULL != tslot->
team;
213#ifdef FREECIV_ENABLE_NLS
214 fc_assert(NULL == tslot->name_translation);
220#ifdef FREECIV_ENABLE_NLS
222 tslot->name_translation =
fc_strdup(buf);
225 log_verbose(
"No name defined for team %d! Creating a default name: %s.",
255#ifdef FREECIV_ENABLE_NLS
259 if (NULL == tslot->name_translation) {
264 return changeable->name_translation;
267 return tslot->name_translation;
289 const char *team_name)
305#ifdef FREECIV_ENABLE_NLS
306 if (NULL != tslot->name_translation) {
307 free(tslot->name_translation);
309 tslot->name_translation =
fc_strdup(
Q_(team_name));
334 }
else if (tslot->
team != NULL) {
345 pteam->
plrlist = player_list_new();
366 player_list_destroy(pteam->
plrlist);
473 }
else if (pteam == pplayer->
team) {
489 pplayer->
team = pteam;
490 player_list_append(pteam->
plrlist, pplayer);
506 if (pplayer->
team != NULL) {
507 pteam = pplayer->
team;
509 log_debug(
"Removing player %d/%s from team %s (%d)",
512 player_list_remove(pteam->
plrlist, pplayer);
514 if (player_list_size(pteam->
plrlist) == 0) {
519 pplayer->
team = NULL;
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_debug(message,...)
#define fc_calloc(n, esz)
int player_number(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
char username[MAX_LEN_NAME]
struct player_list * plrlist
int fc_snprintf(char *str, size_t n, const char *format,...)
size_t fc_strlcpy(char *dest, const char *src, size_t n)
int fc_strcasecmp(const char *str0, const char *str1)
int team_index(const struct team *pteam)
struct team * team_by_number(const int team_id)
const char * team_name_translation(const struct team *pteam)
struct team_slot * team_slot_by_number(int team_id)
void team_slots_free(void)
const char * team_rule_name(const struct team *pteam)
static void team_slot_create_default_name(struct team_slot *tslot)
struct team * team_slot_get_team(const struct team_slot *tslot)
const char * team_slot_name_translation(const struct team_slot *tslot)
struct team_slot * team_slot_first(void)
const char * team_slot_defined_name(const struct team_slot *tslot)
int team_number(const struct team *pteam)
void team_destroy(struct team *pteam)
bool team_slots_initialised(void)
struct team_slot * team_slot_next(struct team_slot *tslot)
bool team_add_player(struct player *pplayer, struct team *pteam)
struct team * team_new(struct team_slot *tslot)
int team_pretty_name(const struct team *pteam, char *buf, size_t buf_len)
int team_slot_index(const struct team_slot *tslot)
struct team_slot * team_slot_by_rule_name(const char *team_name)
const struct player_list * team_members(const struct team *pteam)
void team_slots_init(void)
void team_remove_player(struct player *pplayer)
int team_slot_count(void)
static struct @78 team_slots
bool team_slot_is_used(const struct team_slot *tslot)
void team_slot_set_defined_name(struct team_slot *tslot, const char *team_name)
const char * team_slot_rule_name(const struct team_slot *tslot)
#define team_slots_iterate_end
#define team_slots_iterate(_tslot)
#define MAX_NUM_TEAM_SLOTS