Add RankingResponceNotification
This commit is contained in:
@@ -119,6 +119,10 @@ private void handleGame(Notification notification) {
|
|||||||
guiHandler.addCardOwn(n.getBonusCard());
|
guiHandler.addCardOwn(n.getBonusCard());
|
||||||
app.getAcousticHandler().playSound(MdgaSound.BONUS);
|
app.getAcousticHandler().playSound(MdgaSound.BONUS);
|
||||||
delay = STANDARD_DELAY;
|
delay = STANDARD_DELAY;
|
||||||
|
} else if(notification instanceof RankingResponceNotification n) {
|
||||||
|
n.getRankingResults().forEach((c, i) -> {
|
||||||
|
guiHandler.rollRankingResult(c, i);
|
||||||
|
});
|
||||||
} else if (notification instanceof ActivePlayerNotification n) {
|
} else if (notification instanceof ActivePlayerNotification n) {
|
||||||
gameView.getGuiHandler().setActivePlayer(n.getColor());
|
gameView.getGuiHandler().setActivePlayer(n.getColor());
|
||||||
boardHandler.hideDice();
|
boardHandler.hideDice();
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package pp.mdga.notification;
|
||||||
|
|
||||||
|
import pp.mdga.game.Color;
|
||||||
|
import pp.mdga.message.server.ServerMessage;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class RankingResponceNotification extends Notification {
|
||||||
|
private final Map<Color, Integer> rankingResults;
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param rankingResults as the results of all players after the start player was determined as a Map combining
|
||||||
|
* Integers and Integers.
|
||||||
|
*/
|
||||||
|
public RankingResponceNotification(Map<Color, Integer> rankingResults) {
|
||||||
|
super();
|
||||||
|
this.rankingResults = rankingResults;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method will be used to return rankingResults attribute of RankingResponseMessage class.
|
||||||
|
*
|
||||||
|
* @return rankingResults as a Map combining Integers and Integers.
|
||||||
|
*/
|
||||||
|
public Map<Color, Integer> getRankingResults() {
|
||||||
|
return this.rankingResults;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user