Question on Board::canAddPiece


the comment in the Board interface asks for the canAddPiece (and canRemovePiece) to check, whether “the coordinates are on the board”. Is this referring to the row and column argument or whether the full “hitbox” for the piece will fit into our board?

The method should check whether the piece can be placed.
Therefore, all fields the piece occupies have to be inside the board.

1 Like