Package com.mg105.use_cases.map
Class RoomUpdater
java.lang.Object
com.mg105.use_cases.map.RoomUpdater
- All Implemented Interfaces:
RoomUpdaterInterface
RoomUpdater updates any components that need updating when the state of the current room changes.
One example of a component that might need updating is the GUI.
RoomUpdater makes use of the Java9+ Observable pattern.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addObserver
(@NotNull PropertyChangeListener observer) Add a new observer to the RoomUpdater.void
removeObserver
(@NotNull PropertyChangeListener observer) Remove an observer from the RoomUpdater.void
Trigger an update on all the components that need updating on a room state change.
-
Constructor Details
-
RoomUpdater
public RoomUpdater()Create a new RoomUpdater.
-
-
Method Details
-
updateRoom
public void updateRoom()Trigger an update on all the components that need updating on a room state change.- Specified by:
updateRoom
in interfaceRoomUpdaterInterface
-
addObserver
Add a new observer to the RoomUpdater.- Parameters:
observer
- an observer that requires notification of room changes.
-
removeObserver
Remove an observer from the RoomUpdater.- Parameters:
observer
- an observer that no longer requires notification of room changes.
-