corrected an error in the BattleState class

receivedEffect-function added remaining Opponent Ships to ownMap instead of opponentMap
This commit is contained in:
Timo Brennförder
2024-10-02 12:12:51 +02:00
parent 09f3e9e403
commit b56f4d35a3

View File

@@ -60,7 +60,7 @@ public void receivedEffect(EffectMessage msg) {
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));
} }
} }