fix
continuous-integration/drone/push Build is passing Details

test_old_branch
Jérémy Mouyon 12 months ago
parent d92d2317c9
commit bca09032f9

@ -120,6 +120,8 @@ static void MenuSwitch(Game game)
while (enter != 3) while (enter != 3)
{ {
ShowBoard(game);
ShowTiles(game); ShowTiles(game);
WriteLine("\n --------------------- CHOICES ------------------------"); WriteLine("\n --------------------- CHOICES ------------------------");
@ -145,6 +147,29 @@ static void MenuSwitch(Game game)
} }
} }
static void ShowBoard(Game game)
{
Board board = game.GetBoard();
List<Cell> cells = board.GetCells();
for(int i=0; i<board.Rows; i++)
{
for(int y=0; y<board.Columns; y++)
{
if(board.GetCell(i, y).IsFree == false)
{
Tile tile = board.GetCell(i, y).GetTile;
Console.Write("| " + tile.GetShape.ToString()[0] + tile.GetShape.ToString()[1] + tile.GetColor.ToString()[0] + " |");
}
else
{
Console.Write("| |");
}
}
Console.WriteLine();
}
}
static void MainMenu(Game game) static void MainMenu(Game game)
{ {
game.GiveTilesToPlayers(); game.GiveTilesToPlayers();
@ -170,7 +195,7 @@ static void MainGame()
{ {
Game game = new Game(); Game game = new Game();
Console.ForegroundColor = ConsoleColor.DarkGreen; Console.ForegroundColor = ConsoleColor.DarkGray;
WriteLine(" ===================== WELCOME TO QWIRKLE ! ====================="); WriteLine(" ===================== WELCOME TO QWIRKLE ! =====================");
WriteLine("Enter the players' nametags (2 to 4 players) : "); WriteLine("Enter the players' nametags (2 to 4 players) : ");
Console.ResetColor(); Console.ResetColor();

@ -27,7 +27,7 @@ public class TestBoard
public void Test_BoardAddSolo(bool except, int x, int y, Tile t) public void Test_BoardAddSolo(bool except, int x, int y, Tile t)
{ {
Board b = new Board(x, y); Board b = new Board(12, 12);
if (!except) if (!except)
{ {
@ -62,18 +62,7 @@ public class TestBoard
{ {
Board board = new Board(12, 12); Board board = new Board(12, 12);
List<Cell> cells = new List<Cell>(); Assert.Equal((12 * 12), board.GetCells().Count());
for (int a = 0; a<12; a++)
{
for (int b = 0; b<12; b++)
{
Cell localcell = new(a, b);
cells.Add(localcell);
}
}
Assert.Equal(cells, board.GetCells());
} }
[Fact] [Fact]
@ -93,7 +82,7 @@ public class TestBoard
} }
ReadOnlyCollection<Cell> readCells = cells.AsReadOnly(); ReadOnlyCollection<Cell> readCells = cells.AsReadOnly();
Assert.Equal(readCells, board.GetReadCells()); Assert.Equal(readCells.Count(), board.GetReadCells().Count());
} }

Loading…
Cancel
Save