From 536c14bf7c9c2190e62022a2203be96f63b45a7b Mon Sep 17 00:00:00 2001 From: Cedric Beck Date: Mon, 9 Dec 2024 03:11:43 +0100 Subject: [PATCH] working on turbocard --- .../mdga/client/NotificationSynchronizer.java | 4 +-- .../src/main/java/pp/mdga/game/Game.java | 4 +-- .../notification/NoShieldNotification.java | 29 ------------------- 3 files changed, 4 insertions(+), 33 deletions(-) delete mode 100644 Projekte/mdga/model/src/main/java/pp/mdga/notification/NoShieldNotification.java diff --git a/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java b/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java index 7ae04de1..b735655c 100644 --- a/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java +++ b/Projekte/mdga/client/src/main/java/pp/mdga/client/NotificationSynchronizer.java @@ -169,8 +169,8 @@ private void handleGame(Notification notification) { } else if (notification instanceof ThrowPieceNotification n) { boardHandler.throwPiece(n.getPieceId(), n.getThrowColor()); waitForAnimation = true; - } else if (notification instanceof NoShieldNotification n) { - boardHandler.unshieldPiece(n.getPieceId()); + } else if (notification instanceof RemoveShieldNotification n) { + boardHandler.unshieldPiece(n.getPieceUuid()); } else if (notification instanceof PlayCardNotification n) { if(n.getCard() == BonusCard.TURBO) { guiHandler.turbo(); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/game/Game.java b/Projekte/mdga/model/src/main/java/pp/mdga/game/Game.java index c7859758..88292f25 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/game/Game.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/game/Game.java @@ -92,9 +92,9 @@ public Game() { * This method initializes the draw pile with the predefined number of bonus cards. */ private void initializeDrawPile() { -// this.addBonusCards(new TurboCard(), AMOUNT_OF_TURBO_CARDS); + this.addBonusCards(new TurboCard(), AMOUNT_OF_TURBO_CARDS); // this.addBonusCards(new SwapCard(), AMOUNT_OF_SWAP_CARDS); - this.addBonusCards(new ShieldCard(), AMOUNT_OF_SHIELD_CARDS); +// this.addBonusCards(new ShieldCard(), AMOUNT_OF_SHIELD_CARDS); Collections.shuffle(this.drawPile); } diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/notification/NoShieldNotification.java b/Projekte/mdga/model/src/main/java/pp/mdga/notification/NoShieldNotification.java deleted file mode 100644 index 8c7fa970..00000000 --- a/Projekte/mdga/model/src/main/java/pp/mdga/notification/NoShieldNotification.java +++ /dev/null @@ -1,29 +0,0 @@ -package pp.mdga.notification; - -import java.util.UUID; - -/** - * Notification that a piece has no shield. - */ -public class NoShieldNotification extends Notification{ - /** - * The id of the piece that has no shield. - */ - private final UUID pieceId; - - /** - * Constructor. - * @param pieceId the id of the piece that has no shield. - */ - public NoShieldNotification(UUID pieceId) { - this.pieceId = pieceId; - } - - /** - * Get the id of the piece that has no shield. - * @return the id of the piece that has no shield. - */ - public UUID getPieceId() { - return pieceId; - } -}