mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-12-01 11:09:44 +01:00
own->opponent
This commit is contained in:
parent
9ca08c3d0c
commit
f6699c2a0a
@ -7,14 +7,14 @@
|
|||||||
|
|
||||||
package pp.battleship.game.client;
|
package pp.battleship.game.client;
|
||||||
|
|
||||||
|
import java.lang.System.Logger.Level;
|
||||||
|
|
||||||
import pp.battleship.message.client.ShootMessage;
|
import pp.battleship.message.client.ShootMessage;
|
||||||
import pp.battleship.message.server.EffectMessage;
|
import pp.battleship.message.server.EffectMessage;
|
||||||
import pp.battleship.model.IntPoint;
|
import pp.battleship.model.IntPoint;
|
||||||
import pp.battleship.model.ShipMap;
|
import pp.battleship.model.ShipMap;
|
||||||
import pp.battleship.notification.Sound;
|
import pp.battleship.notification.Sound;
|
||||||
|
|
||||||
import java.lang.System.Logger.Level;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the state of the client where players take turns to attack each other's ships.
|
* Represents the state of the client where players take turns to attack each other's ships.
|
||||||
*/
|
*/
|
||||||
@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user