Skip to content

Commit

Permalink
modify removePiece() function in Boared class by removing print statm…
Browse files Browse the repository at this point in the history
…ent in case of empty square
  • Loading branch information
OsamaX01 committed Aug 25, 2022
1 parent ee5763e commit e5b6dea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/board/Board.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ public void addPiece(Piece piece) {
}

public void removePiece(Piece piece) {
if (getPieceAt(piece.getLocation()) == null) {
System.out.println("this location has no piece!");
return;
if (getPieceAt(piece.getLocation()) != null) {
setPieceAt(null, piece.getLocation());
}
setPieceAt(null, piece.getLocation());
}

public Board(int row, int column) {
Expand Down
2 changes: 2 additions & 0 deletions src/general/GameState.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package general;public class GameState {
}

0 comments on commit e5b6dea

Please sign in to comment.