Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Minor refactoring on most classes #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'master' into refactor/clean-up
  • Loading branch information
Gafour A. Riadh authored Apr 10, 2020
commit 65227af5e3991b00b6e3fc339bfb11445159120f
6 changes: 3 additions & 3 deletions src/main/java/com/jaeheonshim/chessboard/piece/Rook.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 57,9 @@ public boolean canMove(Board board, Spot start, Spot end) {
}
} else if (start.getY() == end.getY()) {
//moving horizontally
if (start.getX() > end.getX()) {
for (int i = start.getX() - 1; i < end.getX(); i--) {
if (board.getSpot(i, start.getY()) != null) {
if(start.getX() > end.getX()) {
for(int i = start.getX() - 1; i > end.getX(); i--) {
if(board.getSpot(i, start.getY()).getPiece() != null) {
//if there are pieces in the way
return false;
}
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.