50 for (; client[index].client_num !=
UNKNOWN; index++);
54static bool check_if_already_taken_pos(
cli_t clients[
MAX_CLIENT],
const int x,
58 if (clients[i].pos[0] == x && clients[i].pos[1] == y) {
74 for (
int i = 0; i < 10; i++) {
85static int init_player(
server_handler_t *server,
const int total,
const int i)
93 for (
int nb = 0; nb < total; nb++) {
103 randomize_player_pos_and_dir(server, index);
112 int nb_value = arguments[index]->
nb_value;
113 char **names = arguments[index]->
value;
120 for (
int i = 0; i < nb_value; i++) {
125 if (init_player(server,
142 for (
int j = 0; j < y; j++) {
147 for (
int i = 0; i < x; i++) {
168 init_map_size(server, arguments);
169 init_ressources_quantity(server);
170 if (init_team_data(server, arguments) == -1) {
173 if (init_map_content(server) == -1) {
void init_client(cli_t client[MAX_CLIENT])
The function to initialize the cli_t structure.
#define DEFAULT_FREQUENCE
! INITIALIZATION VALUE CONSTANTS !!
#define DERAUMERE_DENSITY
int init_game_data(server_handler_t *server, struct arg_s **arguments)
The function to initialize every game data.
int show_game_data(server_handler_t *server, bool need_to_show)
A function to display every data of the game.
A structure to store every client/player data.
ressources_t total_ressources
cli_t clients[MAX_CLIENT]
ressources_t ressources_quantity
A structure to store every tiles content (Must be an 2D array)
A structure to store server general data.
A structure to store every team data.
int client_num_list[MAX_CLIENT]
void * find_value_by_param(const struct arg_s **arguments, char *param)
! FINDER !!
int find_index_by_param(const struct arg_s **arguments, char *param)
Find the index where a parameter is in the arg_s structure by his parameter.
void fill_map(server_handler_t *server)
Fill the map with ressources (use in initialization)
int write_error_msg(const char *str)
! WRITTER !!