added logger and simpliefied logic
This commit is contained in:
@@ -55,9 +55,14 @@ else if (40 > targetIdx && (!piece.getState().equals(PieceState.HOME) || !piece.
|
|||||||
//checks if the target-node is not occupied by an own color
|
//checks if the target-node is not occupied by an own color
|
||||||
if (!tartgetNode.isOccupied(activeColor)) {
|
if (!tartgetNode.isOccupied(activeColor)) {
|
||||||
//checks if the targetNode is not occupied or the occupant ha no shield
|
//checks if the targetNode is not occupied or the occupant ha no shield
|
||||||
if (!tartgetNode.isOccupied() || tartgetNode.getOccupant().getShield() != ShieldState.ACTIVE) {
|
if(tartgetNode.isOccupied()) {
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
if(tartgetNode.getOccupant().getShield().equals(ShieldState.ACTIVE)) {
|
||||||
|
System.out.println("Server: targetNode.getOccupant().getShield().equals(ShieldState.ACTIVE"+tartgetNode.getOccupant().getShield().equals(ShieldState.ACTIVE));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//returns false it the piece can't move
|
//returns false it the piece can't move
|
||||||
|
|||||||
Reference in New Issue
Block a user