added in can infield move to return false when occupant is shielded
This commit is contained in:
@@ -64,6 +64,9 @@ private boolean canInfieldMove(Piece piece, int steps){
|
|||||||
int moveIndex = (pieceIndex + steps) % logic.getGame().getBoard().getInfield().length;
|
int moveIndex = (pieceIndex + steps) % logic.getGame().getBoard().getInfield().length;
|
||||||
Piece occupant = logic.getGame().getBoard().getInfield()[moveIndex].getOccupant();
|
Piece occupant = logic.getGame().getBoard().getInfield()[moveIndex].getOccupant();
|
||||||
if (occupant != null){
|
if (occupant != null){
|
||||||
|
if (occupant.isShielded()){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return occupant.getColor() != piece.getColor();
|
return occupant.getColor() != piece.getColor();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user