Update BattleState.java

This commit is contained in:
Filip Szepielewicz 2024-10-06 20:15:16 +00:00
parent 320baf27ee
commit 107798bfd3

View File

@ -60,7 +60,7 @@ class BattleState extends ClientState {
if (destroyedOpponentShip(msg)) if (destroyedOpponentShip(msg))
logic.getOpponentMap().add(msg.getDestroyedShip()); logic.getOpponentMap().add(msg.getDestroyedShip());
if (msg.isGameOver()) { if (msg.isGameOver()) {
msg.getRemainingOpponentShips().forEach(logic.getOwnMap()::add); msg.getRemainingOpponentShips().forEach(logic.getOpponentMap()::add);
logic.setState(new GameOverState(logic)); logic.setState(new GameOverState(logic));
} }
} }
@ -100,3 +100,6 @@ class BattleState extends ClientState {
logic.playSound(Sound.DESTROYED_SHIP); logic.playSound(Sound.DESTROYED_SHIP);
} }
} }