diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/WaitingState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/WaitingState.java index 30287096..9b1671f9 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/WaitingState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/WaitingState.java @@ -42,7 +42,16 @@ public void received(DiceNowMessage msg) { @Override public void received(DieMessage msg) { logic.getGame().setDiceEyes(msg.getDiceEye()); - logic.addNotification(new RollDiceNotification(logic.getGame().getActiveColor(), logic.getGame().getDiceEyes())); + if(logic.getGame()){ + logic.addNotification(new RollDiceNotification(logic.getGame().getPlayerById(logic.getOwnPlayerId()).getColor(), msg.getDiceEye())); + } + else { + logic.addNotification(new RollDiceNotification(logic.getGame().getPlayerById(logic.getOwnPlayerId()).getColor(), msg.getDiceEye(), logic.getGame().getDiceModifier())); + } +// logic.addNotification(new RollDiceNotification(logic.getGame().getActiveColor(), logic.getGame().getDiceEyes())); + + + //stats if (msg.getDiceEye() == 6) { logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).getPlayerStatistic().increaseDiced6(); logic.getGame().getGameStatistics().increaseDiced6(); diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/RollDiceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/RollDiceState.java index 2d2c1258..ba398d7a 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/RollDiceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/client/gamestate/turnstate/RollDiceState.java @@ -43,7 +43,13 @@ public void selectDice(){ @Override public void received(DieMessage msg){ logic.getGame().setDiceEyes(msg.getDiceEye()); - logic.addNotification(new RollDiceNotification(logic.getGame().getPlayerById(logic.getOwnPlayerId()).getColor(), msg.getDiceEye(),false)); + + if(logic.getGame()){ + logic.addNotification(new RollDiceNotification(logic.getGame().getPlayerById(logic.getOwnPlayerId()).getColor(), msg.getDiceEye())); + } + else { + logic.addNotification(new RollDiceNotification(logic.getGame().getPlayerById(logic.getOwnPlayerId()).getColor(), msg.getDiceEye(), logic.getGame().getDiceModifier())); + } } @Override diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/notification/RollDiceNotification.java b/Projekte/mdga/model/src/main/java/pp/mdga/notification/RollDiceNotification.java index 2e6f03e1..dfc5daf3 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/notification/RollDiceNotification.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/notification/RollDiceNotification.java @@ -13,6 +13,7 @@ public class RollDiceNotification extends Notification{ private int multiplier; private boolean isRanking; + //normal /** * Constructor. * @param color the color of the player that rolled the die. @@ -26,6 +27,7 @@ public RollDiceNotification(Color color, int eyes) { this.isRanking = false; } + //ranking public RollDiceNotification(Color color, int eyes, boolean isRanking) { this.color = color; this.eyes = eyes; @@ -34,10 +36,11 @@ public RollDiceNotification(Color color, int eyes, boolean isRanking) { this.isRanking = isRanking; } - public RollDiceNotification(Color color, int eyes, boolean turbo, int multiplier) { + //turbo + public RollDiceNotification(Color color, int eyes, int multiplier) { this.color = color; this.eyes = eyes; - this.turbo = turbo; + this.turbo = true; this.multiplier = multiplier; this.isRanking = false; }