src/Engine/Models/ChessGame.cs
/// <summary>
/// Gets the chess piece at a particular board position.
/// </summary>
/// <param name="file">The file the piece is on.</param>
/// <param name="rank">The rank the piece is on.</param>
/// <returns>The piece on the indicated square or null if no piece is there.</returns>
Gets the chess piece at a particular board position.
Gets the chess piece at a particular board position .
public ChessPiece? GetPiece(int file, int rank)
        {
            if (file >= BoardSize || rank >= BoardSize || file < 0 || rank < 0)
            {
                return null;
            }
            return boardState[file][rank];
        }
public ChessPiece ? GetPiece ( int file , int rank ) { if ( file >= BoardSize || rank >= BoardSize || file < 0 || rank < 0 ) { return null ; } return boardState [ file ] [ rank ] ; }
Gets the chess piece at a particular board position.
Gets the chess piece at a particular board position .
The piece on the indicated square or null if no piece is there.
The piece on the indicated square or null if no piece is there .
file
int
The file the piece is on.
The file the piece is on .
rank
int
The rank the piece is on.
The rank the piece is on .