creating MapCreation Notification
This commit is contained in:
@@ -4,7 +4,9 @@
|
||||
import pp.mdga.client.ClientState;
|
||||
import pp.mdga.client.DialogsState;
|
||||
import pp.mdga.game.Color;
|
||||
import pp.mdga.game.Piece;
|
||||
import pp.mdga.game.Player;
|
||||
import pp.mdga.game.PlayerData;
|
||||
import pp.mdga.message.client.*;
|
||||
import pp.mdga.message.server.LobbyPlayerJoinedMessage;
|
||||
import pp.mdga.message.server.LobbyPlayerLeaveMessage;
|
||||
@@ -13,6 +15,8 @@
|
||||
import pp.mdga.message.server.UpdateTSKMessage;
|
||||
import pp.mdga.notification.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class LobbyState extends DialogStates {
|
||||
|
||||
private final DialogsState parent;
|
||||
@@ -73,6 +77,13 @@ public void selectStart(){
|
||||
public void received(ServerStartGameMessage msg){
|
||||
logic.getGame().setBoard(msg.getBoard());
|
||||
logic.addNotification(new GameNotification(logic.getGame().getPlayers().get(parent.getOwnPlayerId()).getColor()));
|
||||
for(Map.Entry<Color, PlayerData> entry : msg.getBoard().getPlayerData().entrySet()){
|
||||
List<UUID> pieceIds = new ArrayList<>();
|
||||
for (Piece piece : entry.getValue().getPieces()){
|
||||
pieceIds.add(piece.getUuid());
|
||||
}
|
||||
logic.addNotification(new PlayerInGameNotification(entry.getKey(), pieceIds, logic.getGame().getPlayerByColor(entry.getKey()).getName()));
|
||||
}
|
||||
parent.startGame();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user