fixed missing messages

This commit is contained in:
Cedric Beck
2024-12-01 18:12:31 +01:00
parent 2732a89da6
commit 453aacfe1a
8 changed files with 86 additions and 35 deletions

View File

@@ -34,7 +34,7 @@ public void received(CeremonyMessage msg){
@Override
public void received(DieMessage msg){
logic.getGame().setDiceEyes(msg.getDiceEye());
logic.addNotification(new RollDiceNotification(logic.getGame().getActiveColor(), logic.getGame().getDiceEyes(), logic.getGame().getDiceEyes() * logic.getGame().getDiceModifier()));
// logic.addNotification(new RollDiceNotification(logic.getGame().getActiveColor(), logic.getGame().getDiceEyes(), logic.getGame().getDiceEyes() * logic.getGame().getDiceModifier()));
if(msg.getDiceEye() == 6){
logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).getPlayerStatistic().increaseDiced6();
logic.getGame().getGameStatistics().increaseDiced6();

View File

@@ -40,7 +40,7 @@ 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(), logic.getGame().getDiceEyes() * logic.getGame().getDiceModifier()));
// logic.addNotification(new RollDiceNotification(logic.getGame().getActiveColor(), logic.getGame().getDiceEyes(), logic.getGame().getDiceEyes() * logic.getGame().getDiceModifier()));
if(msg.getDiceEye() == 6){
logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).getPlayerStatistic().increaseDiced6();
logic.getGame().getGameStatistics().increaseDiced6();

View File

@@ -9,18 +9,26 @@ public class RollDiceNotification extends Notification{
private Color color;
private int eyes;
private int moveNumber;
private boolean turbo;
private int multiplier;
/**
* Constructor.
* @param color the color of the player that rolled the die.
* @param eyes the number of eyes that were rolled.
* @param moveNumber the number of the move that was made.
*/
public RollDiceNotification(Color color, int eyes, int moveNumber) {
public RollDiceNotification(Color color, int eyes) {
this.color = color;
this.eyes = eyes;
this.moveNumber = moveNumber;
this.turbo = false;
this.multiplier = -1;
}
public RollDiceNotification(Color color, int eyes, boolean turbo, int multiplier) {
this.color = color;
this.eyes = eyes;
this.turbo = turbo;
this.multiplier = multiplier;
}
/**
@@ -39,11 +47,11 @@ public int getEyes() {
return eyes;
}
/**
* Get the number of the move that was made.
* @return the number of the move that was made.
*/
public int getMoveNumber() {
return moveNumber;
public int getMultiplier() {
return multiplier;
}
public boolean isTurbo() {
return turbo;
}
}

View File

@@ -0,0 +1,16 @@
package pp.mdga.notification;
import java.util.List;
import java.util.UUID;
public class SelectableShieldNotification extends Notification{
private List<UUID> pieces;
public SelectableShieldNotification(List<UUID> pieces){
this.pieces = pieces;
}
public List<UUID> getPieces() {
return pieces;
}
}

View File

@@ -0,0 +1,4 @@
package pp.mdga.notification;
public class TurboActiveNotification extends Notification{
}