From 9ca08c3d0caf024713dbd320915995aedd6dad38 Mon Sep 17 00:00:00 2001 From: Luca Puderbach Date: Sun, 6 Oct 2024 00:53:15 +0200 Subject: [PATCH] added -> removed --- .../src/main/java/pp/battleship/model/ShipMap.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Projekte/battleship/model/src/main/java/pp/battleship/model/ShipMap.java b/Projekte/battleship/model/src/main/java/pp/battleship/model/ShipMap.java index bb73d6b..59a2164 100644 --- a/Projekte/battleship/model/src/main/java/pp/battleship/model/ShipMap.java +++ b/Projekte/battleship/model/src/main/java/pp/battleship/model/ShipMap.java @@ -7,15 +7,16 @@ package pp.battleship.model; -import pp.battleship.notification.GameEvent; -import pp.battleship.notification.GameEventBroker; -import pp.battleship.notification.ItemAddedEvent; - import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.stream.Stream; +import pp.battleship.notification.GameEvent; +import pp.battleship.notification.GameEventBroker; +import pp.battleship.notification.ItemAddedEvent; +import pp.battleship.notification.ItemRemovedEvent; + /** * Represents a rectangular map that holds ships and registers shots fired. * It also supports event notification for game state changes such as item addition or removal. @@ -97,7 +98,7 @@ public class ShipMap { */ public void remove(Item item) { items.remove(item); - notifyListeners(new ItemAddedEvent(item, this)); + notifyListeners(new ItemRemovedEvent(item, this)); } /**