remove method

Piece? remove(
  1. String square
)

Removes a piece from a square and returns it, or null if none is present

Implementation

Piece? remove(String square) {
  final piece = get(square);
  board[SQUARES[square]] = null;
  if (piece != null && piece.type == KING) {
    kings[piece.color] = EMPTY;
  }

  update_setup(generate_fen());

  return piece;
}