Class GameFinishedController
java.lang.Object
edu.ntnu.idi.idatt.controller.common.GameFinishedController
- All Implemented Interfaces:
ButtonClickObserver
GameFinishedController
Controls the GameFinishedView
. It handles user interactions on the game finished
screen, such as restarting the game or returning to the main menu.
-
Constructor Summary
ConstructorsConstructorDescriptionGameFinishedController
(GameFinishedView view, List<Player> rankedPlayers) Constructor for GameFinishedController. -
Method Summary
Modifier and TypeMethodDescriptionvoid
onButtonClicked
(String buttonId) Handles button click events from theGameFinishedView
.void
onButtonClickedWithParams
(String buttonId, Map<String, Object> params) Handles button click events with parameters.void
setOnMainMenu
(Runnable onMainMenu) Sets the callback to run when the "Main Menu" button is clicked.
-
Constructor Details
-
GameFinishedController
Constructor for GameFinishedController.- Parameters:
view
- TheGameFinishedView
to control.rankedPlayers
- The list of players, sorted by rank, to display.
-
-
Method Details
-
setOnMainMenu
Sets the callback to run when the "Main Menu" button is clicked.- Parameters:
onMainMenu
- The main menu callback.
-
onButtonClicked
Handles button click events from theGameFinishedView
.- Specified by:
onButtonClicked
in interfaceButtonClickObserver
- Parameters:
buttonId
- The ID of the button that was clicked.
-
onButtonClickedWithParams
Handles button click events with parameters. Not directly used by this controller's view but implemented as part ofButtonClickObserver
.- Specified by:
onButtonClickedWithParams
in interfaceButtonClickObserver
- Parameters:
buttonId
- The button ID.params
- The parameters.
-