diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/ClientGameLogic.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/ClientGameLogic.java index 8e88dda5..17f30412 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/ClientGameLogic.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/ClientGameLogic.java @@ -267,6 +267,10 @@ public void selectStart(){ state.selectStart(); } + public void selectResume(){ + state.selectResume(); + } + public void setState(ClientState state){ this.state.exit(); state.enter(); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/ClientState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/ClientState.java index 97d058a5..336912a9 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/ClientState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/ClientState.java @@ -236,6 +236,10 @@ public void selectNext(){ LOGGER.log(Level.DEBUG, "Next not allowed"); } + public void selectResume(){ + LOGGER.log(Level.DEBUG, "Resume not allowed"); + } + protected CeremonyNotification createCeremonyNotification(){ CeremonyNotification notification = new CeremonyNotification(); for (var player : logic.getGame().getPlayers().entrySet()){ diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/InterruptState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/InterruptState.java index 7ea0e21d..1537b748 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/InterruptState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/InterruptState.java @@ -1,5 +1,6 @@ package pp.mdga.client; +import pp.mdga.message.client.ForceContinueGameMessage; import pp.mdga.message.server.ResumeGameMessage; import pp.mdga.notification.ResumeNotification; @@ -29,6 +30,13 @@ public ClientState getPreviousState() { return previousState; } + @Override + public void selectResume(){ + if(logic.isHost()){ + logic.send(new ForceContinueGameMessage()); + } + } + public void received(ResumeGameMessage msg) { //TODO: logic.addNotification(new ResumeNotification()); logic.setState(previousState); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/DieMessage.java b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/DieMessage.java index 11cf206e..abf018a9 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/message/server/DieMessage.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/message/server/DieMessage.java @@ -18,9 +18,8 @@ public class DieMessage extends ServerMessage { * Constructor for Dice * * @param diceEye the eye of the dice - * @param moveablePieces the pieces that can be moved */ - public DieMessage(int diceEye, List moveablePieces) { + public DieMessage(int diceEye) { super(); this.diceEye = diceEye; } @@ -28,31 +27,10 @@ public DieMessage(int diceEye, List moveablePieces) { /** * Default constructor for serialization purposes. */ - private DieMessage() { + public DieMessage() { diceEye = 0; } - /** - * Constructor for inactivePlayer - * - * @param diceEye the eye of the dice - * @return a new Dice object - */ - public static DieMessage inactivePlayer(int diceEye) { - return new DieMessage(diceEye, null); - } - - /** - * Constructor for activePlayer - * - * @param diceEye the eye of the dice - * @param moveablePieces the pieces that can be moved - * @return a new Dice object - */ - public static DieMessage activePlayer(int diceEye, List moveablePieces) { - return new DieMessage(diceEye, moveablePieces); - } - /** * Getter for the eye of the dice *