diff --git a/Qwirkle/QwirkleClassLibrary/Game.cs b/Qwirkle/QwirkleClassLibrary/Game.cs index ebd470d..2575d90 100644 --- a/Qwirkle/QwirkleClassLibrary/Game.cs +++ b/Qwirkle/QwirkleClassLibrary/Game.cs @@ -80,6 +80,20 @@ namespace QwirkleClassLibrary } } + public void NextPlayer() + { + int posPlayerPlay = PositionPlayerPlay(); + + int posPlayerNextPlay = PositionPlayerPlay() + 1; + + if (posPlayerNextPlay >= GetNbPlayers) + { + posPlayerNextPlay = 0; + } + + SetNextPlayer(posPlayerPlay, posPlayerNextPlay); + } + } diff --git a/Qwirkle/QwirkleConsoleApp/Program.cs b/Qwirkle/QwirkleConsoleApp/Program.cs index 139ad3f..0b39762 100644 --- a/Qwirkle/QwirkleConsoleApp/Program.cs +++ b/Qwirkle/QwirkleConsoleApp/Program.cs @@ -55,32 +55,16 @@ static Game InitializerGame() 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() { Game game = InitializerGame(); Write("\n -------------------------------------------------------- \n"); - NextPlayer(game); - NextPlayer(game); - NextPlayer(game); - NextPlayer(game); + game.NextPlayer(); + game.NextPlayer(); + game.NextPlayer(); + game.NextPlayer(); game.TilsBagPlayer();