working on turbo not
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user