2020-12-16 05:01:39 +01:00
|
|
|
|
|
|
|
#include "bygfoot.h"
|
|
|
|
#include "misc.h"
|
2020-12-24 02:26:13 +01:00
|
|
|
#include "start_end.h"
|
2020-12-16 05:01:39 +01:00
|
|
|
#include "user.h"
|
|
|
|
#include "xml_country.h"
|
|
|
|
|
|
|
|
User *bygfoot_add_user(Bygfoot *bygfoot, const gchar *username, Team *tm)
|
|
|
|
{
|
|
|
|
User new_user = user_new();
|
|
|
|
new_user.tm = tm;
|
|
|
|
new_user.team_id = tm->id;
|
|
|
|
|
|
|
|
/* FIXME: Use strnlen */
|
|
|
|
if(strlen(username) > 0)
|
|
|
|
misc_string_assign(&new_user.name, username);
|
|
|
|
|
|
|
|
g_array_append_val(users, new_user);
|
|
|
|
return &g_array_index(users, User, users->len - 1);
|
|
|
|
}
|
2020-12-24 02:26:13 +01:00
|
|
|
|
|
|
|
void bygfoot_start_game(Bygfoot *bygfoot)
|
|
|
|
{
|
|
|
|
unsigned i;
|
|
|
|
|
|
|
|
start_new_game();
|
|
|
|
for (i = 0; i < users->len; i++)
|
|
|
|
user_set_up_team_new_game(&usr(i));
|
|
|
|
}
|