Package edu.ntnu.idi.idatt.observer
Interface ButtonClickSubject
- All Known Implementing Classes:
BoardCreatorView
,GameFinishedView
,GameSelectionView
,GameView
,LadderGameBoardCreatorView
,LadderGameMenuView
,LadderGameView
,LudoBoardCreatorView
,LudoGameMenuView
,LudoGameView
,MenuView
public interface ButtonClickSubject
ButtonClickSubject interface
This interface defines the methods for classes that need to notify observers of button click events.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addObserver
(ButtonClickObserver observer) Adds an observer to the subject.void
notifyObservers
(String buttonId) Notifies all observers.void
notifyObserversWithParams
(String buttonId, Map<String, Object> params) Notifies all observers, with a map of parameters.void
removeObserver
(ButtonClickObserver observer) Removes an observer from the subject.
-
Method Details
-
addObserver
Adds an observer to the subject.- Parameters:
observer
- the observer to add
-
removeObserver
Removes an observer from the subject.- Parameters:
observer
- the observer to remove
-
notifyObservers
Notifies all observers.- Parameters:
buttonId
- the ID of the button clicked
-
notifyObserversWithParams
Notifies all observers, with a map of parameters.- Parameters:
buttonId
- the ID of the button clickedparams
- the parameters of the button click event
-