internal static void PrintMatch(ChessMatch match) { PrintBoard(match.Board); Console.WriteLine(); PrintCapturedPieces(match); Console.WriteLine(); Console.WriteLine("Turn: " + match.Turns); if (!match.IsMatchCompleted) { Console.WriteLine($"Waiting player: {match.ActualPlayer}"); if (match.IsCheck) { ConsoleExt.WriteLineColored("CHECK!", ConsoleColor.Red); } } else { ConsoleColor?color = match.ActualPlayer == Color.Black ? ConsoleColor.DarkYellow : Console.ForegroundColor; ConsoleExt.WriteLineColored("CHECK MATE!", color); ConsoleExt.WriteLineColored($"Player {match.ActualPlayer} Won! \n", color); Console.WriteLine("Press any key to exit..."); Console.ReadLine(); } Console.WriteLine(); }
private static void PrintSetPieces(IEnumerable <Piece> pieces, ConsoleColor foregroundColor) { ConsoleExt.WriteColored("{ ", foregroundColor); foreach (var piece in pieces) { ConsoleExt.WriteColored($"{piece} ", foregroundColor); } ConsoleExt.WriteLineColored("}", foregroundColor); }
private static void PrintBoardFooter() { ConsoleExt.WriteLineColored(" a b c d e f g h", ConsoleColor.Cyan); }