the code is so spaghetti but it WORKS, need to add docstrings and finish
all pieces
This commit is contained in:
parent
e99013d05e
commit
f3be5c6f6c
|
|
@ -268,18 +268,23 @@ public class Board {
|
|||
}
|
||||
} k = 8;
|
||||
for (int i = 1; i < k; i++) {
|
||||
if (getPiece(selectX + i, selectY - i) != null && color != getPiece(selectX + i, selectY - i).isWhite()) {
|
||||
k = i+1;
|
||||
break;
|
||||
}else{
|
||||
k = i;
|
||||
break;
|
||||
if (getPiece(selectX + i, selectY - i) != null) {
|
||||
if (color != getPiece(selectX + i, selectY - i).isWhite()) {
|
||||
k = i+1;
|
||||
if (selectX + i == x && selectY - i == y) {
|
||||
isAPieceHere = true;
|
||||
}
|
||||
break;
|
||||
|
||||
}else{
|
||||
k = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (selectX + k == x && selectY - k == y) {
|
||||
if (selectX + i == x && selectY - i == y) {
|
||||
isAPieceHere = true;
|
||||
}
|
||||
|
||||
}
|
||||
} else if (type == PieceType.Rook) {
|
||||
for(int i = 1; i < 8;i++) {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue