|
|
@ -92,6 +92,8 @@ public class ChessBoard { |
|
|
|
sourceY += stepY; |
|
|
|
if (!isCellInBoard(sourceX, sourceY) || !isCellInBoard(destX, destY)) |
|
|
|
return false; |
|
|
|
if(Math.abs(deltaX) <= 1 && Math.abs(deltaY) <= 1) |
|
|
|
return true; |
|
|
|
while (!(sourceX == destX && sourceY == destY)) { |
|
|
|
if (board[sourceY][sourceX] != null) |
|
|
|
return false; |
|
|
@ -119,7 +121,7 @@ public class ChessBoard { |
|
|
|
return this.board; |
|
|
|
} |
|
|
|
|
|
|
|
protected void setChessBoard(ChessFigure[][] board) { |
|
|
|
public void setChessBoard(ChessFigure[][] board) { |
|
|
|
this.board = board; |
|
|
|
} |
|
|
|
} |