adjusted LobbyState in the client to use the correct Data

This commit is contained in:
Hanno Fleischer
2024-12-03 18:19:55 +01:00
parent 81cb2f33ff
commit 7053b163e5
2 changed files with 2 additions and 4 deletions

View File

@@ -78,9 +78,8 @@ public void received(ServerStartGameMessage msg){
logic.getGame().setBoard(msg.getBoard());
logic.addNotification(new GameNotification(logic.getGame().getPlayerById(logic.getOwnPlayerId()).getColor()));
for (Map.Entry<Integer, Player> entry : logic.getGame().getPlayers().entrySet()) {
entry.getValue().initialize();
List<UUID> pieces = new ArrayList<>();
for(Piece piece : entry.getValue().getPieces()){
for (Piece piece : logic.getGame().getBoard().getPlayerData().get(entry.getValue().getColor()).getPieces()) {
pieces.add(piece.getUuid());
}
logic.addNotification(new PlayerInGameNotification(entry.getValue().getColor(), pieces, entry.getValue().getName()));

View File

@@ -36,8 +36,7 @@ protected void handlePowerCard(PlayCardMessage msg){
logic.getGame().getBoard().getInfield()[logic.getGame().getBoard().getInfieldIndexOfPiece(enemyPiece)].setOccupant(ownPiece);
logic.getGame().getBoard().getInfield()[ownIndex].setOccupant(enemyPiece);
}
logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).removeHandCard(msg.getCard());
logic.getGame().getDiscardPile().add(msg.getCard());
logic.getGame().getDiscardPile().add(logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).removeHandCard(msg.getCard()));
}
protected void throwPiece(Piece piece){