as the moovepool of the queen is one of a rook and bishop combined, an
or operator does the trick ! QUeen finished
This commit is contained in:
parent
d62bdf7ad0
commit
7b01772895
|
|
@ -252,15 +252,7 @@ public class Board {
|
|||
isAPieceHere = move.isRookMoveValid(x, y, color, selectX, selectY);
|
||||
|
||||
} else if (type == PieceType.Queen) {
|
||||
for(int i = 1; i < 8;i++) {
|
||||
|
||||
if(selectX == x+i && selectY == y || selectX == x && selectY == y+i ||
|
||||
selectX == x-i && selectY == y || selectX == x && selectY == y-i ||
|
||||
selectX == x+i && selectY == y+i || selectX == x-i && selectY == y-i ||
|
||||
selectX == x-i && selectY == y+i || selectX == x+i && selectY == y-i) {
|
||||
isAPieceHere = true;
|
||||
}
|
||||
}
|
||||
isAPieceHere = (move.isBishopMoveValid(x, y, color, selectX, selectY) || move.isRookMoveValid(x, y, color, selectX, selectY));
|
||||
|
||||
} else if (type == PieceType.Knight) {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue