merge the new developmentbranch into the test branch #39

Closed
j23f0712 wants to merge 431 commits from development2 into dev/test
269 changed files with 14842 additions and 2713 deletions
Showing only changes of commit 6ab8f2d90d - Show all commits

View File

@@ -37,15 +37,6 @@ protected void handlePowerCard(PlayCardMessage msg) {
logic.getGame().getDiscardPile().add(msg.getCard());
}
protected void throwPiece(Piece piece) {
logic.getGame().getBoard().getInfield()[logic.getGame().getBoard().getInfieldIndexOfPiece(piece)].clearOccupant();
logic.getGame().getPlayerByColor(piece.getColor()).addWaitingPiece(piece);
logic.addNotification(new ThrowPieceNotification(piece.getUuid(), piece.getColor()));
logic.getGame().getPlayerByColor(piece.getColor()).getPlayerStatistic().increasePiecesBeingThrown();
logic.getGame().getGameStatistics().increasePiecesBeingThrown();
piece.setState(PieceState.WAITING);
}
private void handleShield(UUID uuid) {
Board board = logic.getGame().getBoard();
Piece piece = logic.getGame().getPieceThroughUUID(uuid);
@@ -70,6 +61,22 @@ private void swapPieces(Piece messageOwn, Piece messageEnemy) {
ownNode.setOccupant(modelEnemy);
enemyNode.setOccupant(modelOwn);
logic.addNotification(new SwapPieceNotification(modelOwn.getUuid(), modelEnemy.getUuid()));
checkShieldAfterSwap(enemyNode, modelOwn);
checkShieldAfterSwap(ownNode, modelEnemy);
}
private void checkShieldAfterSwap(Node node, Piece piece){
if (node.isStart()){
if (piece.isShielded()){
piece.setShield(ShieldState.SUPPRESSED);
logic.addNotification(new ShieldSuppressedNotification(piece.getUuid()));
}
} else if (piece.isSuppressed()){
piece.setShield(ShieldState.ACTIVE);
logic.addNotification(new ShieldActiveNotification(piece.getUuid()));
}
}
}