public void ShowBoard() { Coordinate square = new Coordinate(8, 1); Console.WriteLine("----------------"); for (int rank = 0; rank < 8; rank++) { for (int file = 1; file <= 8; file++) { if (this[square] != null) { Console.Write(" "); var letter = this[square].NotationLetter == ' ' ? 'P' : this[square].NotationLetter; letter = square.GetPiece(this).Color == Color.White ? letter : char.ToLower(letter); Console.Write(letter); } else { Console.Write(" -"); } square = new Coordinate(square.Rank, square.File + 1); } Console.WriteLine(); square = new Coordinate(square.Rank - 1, 1); } Console.WriteLine("----------------"); }
public Ordinary(Board board, Piece piece, Coordinate to) : base(piece) { To = to; CapturedPiece = To.GetPiece(board); }