switch nextplayer to method

test_old_branch
Jérémy Mouyon 1 year ago
parent 9fab296d77
commit 342de5ce08

@ -80,6 +80,20 @@ namespace QwirkleClassLibrary
} }
} }
public void NextPlayer()
{
int posPlayerPlay = PositionPlayerPlay();
int posPlayerNextPlay = PositionPlayerPlay() + 1;
if (posPlayerNextPlay >= GetNbPlayers)
{
posPlayerNextPlay = 0;
}
SetNextPlayer(posPlayerPlay, posPlayerNextPlay);
}
} }

@ -55,32 +55,16 @@ static Game InitializerGame()
return new Game(Players); return new Game(Players);
} }
static void NextPlayer(Game game)
{
int posPlayerPlay = game.PositionPlayerPlay();
int posPlayerNextPlay = game.PositionPlayerPlay() + 1;
if (posPlayerNextPlay >= game.GetNbPlayers)
{
posPlayerNextPlay = 0;
}
game.SetNextPlayer(posPlayerPlay, posPlayerNextPlay);
}
static void testJeremy() static void testJeremy()
{ {
Game game = InitializerGame(); Game game = InitializerGame();
Write("\n -------------------------------------------------------- \n"); Write("\n -------------------------------------------------------- \n");
NextPlayer(game); game.NextPlayer();
NextPlayer(game); game.NextPlayer();
NextPlayer(game); game.NextPlayer();
NextPlayer(game); game.NextPlayer();
game.TilsBagPlayer(); game.TilsBagPlayer();

Loading…
Cancel
Save