Players are added to the game

availableIslands
thmaillarb 4 years ago
parent 92d3be2971
commit 9b80275cbb

@ -10,7 +10,7 @@
#include "model/Player.h"
#include "model/Board.h"
#include <SDL2/SDL_pixels.h>
/**
* \enum Phase

@ -6,8 +6,22 @@ Game newGame(int nbPlayers) {
g.currentPlayerID = nbPlayers - 1;
g.nb_rounds = 0;
g.state = PLACEMENT;
// TODO newBoard
// TODO initPlayers (avec gestion des couleurs)
g.board = newBoard(nbPlayers);
// red, green, blue, yellow
// TODO meilleures couleurs (?)
SDL_Color colors[4] {
{255,0 ,0 ,255},
{0 ,255,0 ,255},
{0 ,0 ,255,255},
{255,255,0 ,255}
};
// TODO récup pseudos
for (int player_i = 0; player_i < nbPlayers; player_i++) {
g.arrPlayers[player_i] = newPlayer("Pseudo",colors[player_i]);
}
return g;
}

Loading…
Cancel
Save