knight finished
This commit is contained in:
parent
6787c0eae2
commit
a8c96922a5
|
|
@ -237,37 +237,59 @@ public class Move {
|
|||
}
|
||||
|
||||
if (selectX == x - 1 && selectY == y - 2) {
|
||||
|
||||
if(board.getPiece(x, y) != null) {
|
||||
return color != board.getPiece(x, y).isWhite();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (selectX == x - 1 && selectY == y + 2) {
|
||||
return true;
|
||||
if(board.getPiece(x, y) != null) {
|
||||
return color != board.getPiece(x, y).isWhite();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (selectX == x + 1 && selectY == y - 2) {
|
||||
return true;
|
||||
if(board.getPiece(x, y) != null) {
|
||||
return color != board.getPiece(x, y).isWhite();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (selectX == x + 2 && selectY == y + 1) {
|
||||
return true;
|
||||
if(board.getPiece(x, y) != null) {
|
||||
return color != board.getPiece(x, y).isWhite();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (selectX == x - 2 && selectY == y - 1) {
|
||||
return true;
|
||||
if(board.getPiece(x, y) != null) {
|
||||
return color != board.getPiece(x, y).isWhite();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (selectX == x - 2 && selectY == y + 1) {
|
||||
return true;
|
||||
if(board.getPiece(x, y) != null) {
|
||||
return color != board.getPiece(x, y).isWhite();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (selectX == x + 2 && selectY == y - 1) {
|
||||
return true;
|
||||
if(board.getPiece(x, y) != null) {
|
||||
return color != board.getPiece(x, y).isWhite();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue