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