getPiece method

ChessPiece? getPiece(
  1. Position position
)

Get the piece at the specified position.

Implementation

ChessPiece? getPiece(Position position) {
  return board[position.row][position.col];
}