added TODOÃ's for presentation

This commit is contained in:
Cedric Beck
2024-10-12 17:45:30 +02:00
parent bb1e3858bb
commit 67b99317d2
10 changed files with 13 additions and 3 deletions

View File

@@ -57,9 +57,10 @@ public void receivedEffect(EffectMessage msg) {
myTurn = msg.isMyTurn();
logic.setInfoText(msg.getInfoTextKey());
//TODO: Ex. 13 add shell -> ItemAddedEvent
Shell shell = new Shell(msg.getShot());
affectedMap(msg).add(shell);
//TODO: Ex. 13 Shell sound -> GameSound
logic.playSound(Sound.SHELL_FLYING);
logic.setState(new ShootingState(logic, shell, myTurn, msg));
}

View File

@@ -26,6 +26,7 @@ public class ShootingState extends ClientState {
* @param msg the effect message associated with the shooting action
*/
public ShootingState(ClientGameLogic logic, Shell shell, boolean myTurn, EffectMessage msg) {
//TODO: Ex. 13 ShootingState
super(logic);
this.msg = msg;
this.myTurn = myTurn;

View File

@@ -221,6 +221,7 @@ private boolean checkMap(List<Battleship> ships) {
*/
@Override
public void received(ShootMessage msg, int from) {
//TODO: Ex. 13 Server State
if (state != ServerState.BATTLE)
LOGGER.log(Level.ERROR, "shoot not allowed in {0}", state); //NON-NLS
else{

View File

@@ -9,6 +9,7 @@
* a Bezier curve.
*/
public class Shell implements Item {
//TODO: Ex. 13 Shell
/**
* Initial position of the shell
*/