added RankingResponseNotification to be sent to the client
This commit is contained in:
@@ -3,9 +3,14 @@
|
|||||||
import pp.mdga.client.ClientGameLogic;
|
import pp.mdga.client.ClientGameLogic;
|
||||||
import pp.mdga.client.ClientState;
|
import pp.mdga.client.ClientState;
|
||||||
import pp.mdga.client.gamestate.DetermineStartPlayerState;
|
import pp.mdga.client.gamestate.DetermineStartPlayerState;
|
||||||
|
import pp.mdga.game.Color;
|
||||||
import pp.mdga.message.client.AnimationEndMessage;
|
import pp.mdga.message.client.AnimationEndMessage;
|
||||||
import pp.mdga.message.server.*;
|
import pp.mdga.message.server.*;
|
||||||
import pp.mdga.notification.ActivePlayerNotification;
|
import pp.mdga.notification.ActivePlayerNotification;
|
||||||
|
import pp.mdga.notification.RankingResponceNotification;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class WaitRankingState extends DetermineStartPlayerStates {
|
public class WaitRankingState extends DetermineStartPlayerStates {
|
||||||
|
|
||||||
@@ -45,7 +50,11 @@ public void received(DiceNowMessage msg){
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void received(RankingResponseMessage msg){
|
public void received(RankingResponseMessage msg){
|
||||||
|
Map<Color, Integer> rankingResults = new HashMap<>();
|
||||||
|
for (var entry : msg.getRankingResults().entrySet()) {
|
||||||
|
rankingResults.put(logic.getGame().getPlayerById(entry.getKey()).getColor(), entry.getValue());
|
||||||
|
}
|
||||||
|
logic.addNotification(new RankingResponceNotification(rankingResults));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user