Exemple #1
0
        public static void PrintChessBoard(ChessBoard chessBoard, ChessPosition origin)
        {
            Console.Clear();

            for (int l = 0; l < ChessBoard.Lines; l++)
            {
                PrintChessBoardVerticalLabel(l);

                for (int c = 0; c < ChessBoard.Columns; c++)
                {
                    var currentPosition = new Position(l, c);
                    bool[,] possibleMovements = chessBoard.GetPiece(origin.ToPosition()).PossibleMovements();

                    if (possibleMovements[l, c])
                    {
                        PrintChessBoardPiece(chessBoard.GetPiece(currentPosition), true);
                    }
                    else
                    {
                        PrintChessBoardPiece(chessBoard.GetPiece(currentPosition));
                    }
                }
                Console.WriteLine();
            }

            PrintChessBoardHorizontalLabel();

            Console.Write("\n\n");
        }