From 6cdf0eee537ce88a6bf7b27d87496a7afbffb67e Mon Sep 17 00:00:00 2001 From: Johannes Schmelz Date: Mon, 9 Dec 2024 05:32:11 +0100 Subject: [PATCH] disable buttons when having to pause one round --- .../src/main/java/pp/monopoly/game/client/ClientGameLogic.java | 2 ++ .../src/main/java/pp/monopoly/game/server/ServerGameLogic.java | 2 +- .../model/src/main/java/pp/monopoly/model/card/DeckHelper.java | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/client/ClientGameLogic.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/client/ClientGameLogic.java index 312ad2c..1d43175 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/client/ClientGameLogic.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/client/ClientGameLogic.java @@ -310,6 +310,8 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker { } else if(msg.getKeyWord().equals("ReceivedRent")) { playSound(Sound.MONEY_COLLECTED); notifyListeners(new PopUpEvent("ReceivedRent", msg)); + } else if (msg.getKeyWord().equals("aussetzen")) { + notifyListeners(new ButtonStatusEvent(false)); } } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java index f53b154..ff055e5 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java @@ -85,7 +85,7 @@ public class ServerGameLogic implements ClientInterpreter { * @param player the Player to whom the message is sent * @param msg the ServerMessage to send */ - void send(Player player, ServerMessage msg) { + public void send(Player player, ServerMessage msg) { if (player != null && msg != null) { serverSender.send(player.getId(), msg); LOGGER.log(Level.DEBUG, "Message sent to player {0}: {1}", player.getName(), msg.getClass().getSimpleName()); diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/card/DeckHelper.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/card/DeckHelper.java index d0605ef..b6aa64d 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/card/DeckHelper.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/card/DeckHelper.java @@ -8,6 +8,7 @@ import java.util.Queue; import pp.monopoly.game.server.Player; import pp.monopoly.message.client.EndTurn; +import pp.monopoly.message.server.NotificationMessage; public class DeckHelper{ @@ -258,6 +259,7 @@ public class DeckHelper{ private void rueckstuferantrag(Player player) { player.getHandler().getLogic().received(new EndTurn(), player.getId()); + player.getHandler().getLogic().send(player, new NotificationMessage("aussetzen")); } private void hausfeierSturz(Player player) {