mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-12-01 12:19:45 +01:00
added -> removed
This commit is contained in:
parent
f47cda7dc4
commit
9ca08c3d0c
@ -7,15 +7,16 @@
|
|||||||
|
|
||||||
package pp.battleship.model;
|
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.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Stream;
|
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.
|
* 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.
|
* 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) {
|
public void remove(Item item) {
|
||||||
items.remove(item);
|
items.remove(item);
|
||||||
notifyListeners(new ItemAddedEvent(item, this));
|
notifyListeners(new ItemRemovedEvent(item, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user