diff --git a/Qwirkle/QwirkleClassLibrary/Game.cs b/Qwirkle/QwirkleClassLibrary/Game.cs index ebd470d..c133e31 100644 --- a/Qwirkle/QwirkleClassLibrary/Game.cs +++ b/Qwirkle/QwirkleClassLibrary/Game.cs @@ -50,7 +50,7 @@ namespace QwirkleClassLibrary foreach(Tile tile in tiles) { - r = (r + tile.NameColorTile()); + r = (r + " " + tile.NameColorTile()); } Console.WriteLine(r); @@ -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/QwirkleClassLibrary/Tile.cs b/Qwirkle/QwirkleClassLibrary/Tile.cs index 4aa4589..0e77538 100644 --- a/Qwirkle/QwirkleClassLibrary/Tile.cs +++ b/Qwirkle/QwirkleClassLibrary/Tile.cs @@ -20,7 +20,7 @@ namespace QwirkleClassLibrary public string NameColorTile() { - return (color.ToString() + " , " + shape.ToString()); + return color.ToString() + shape.ToString(); } public Shape GetShape { 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();