Update ShipMap.java

This commit is contained in:
Filip Szepielewicz 2024-10-06 20:12:43 +00:00
parent f47cda7dc4
commit 320baf27ee

View File

@ -10,6 +10,7 @@ package pp.battleship.model;
import pp.battleship.notification.GameEvent;
import pp.battleship.notification.GameEventBroker;
import pp.battleship.notification.ItemAddedEvent;
import pp.battleship.notification.ItemRemovedEvent;
import java.util.ArrayList;
import java.util.Collections;
@ -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));
}
/**
@ -249,3 +250,5 @@ public class ShipMap {
eventBroker.notifyListeners(event);
}
}