Class GameFinishedController

java.lang.Object
edu.ntnu.idi.idatt.controller.common.GameFinishedController
All Implemented Interfaces:
ButtonClickObserver

public class GameFinishedController extends Object implements 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 Details

    • GameFinishedController

      public GameFinishedController(GameFinishedView view, List<Player> rankedPlayers)
      Constructor for GameFinishedController.
      Parameters:
      view - The GameFinishedView to control.
      rankedPlayers - The list of players, sorted by rank, to display.
  • Method Details

    • setOnMainMenu

      public void setOnMainMenu(Runnable onMainMenu)
      Sets the callback to run when the "Main Menu" button is clicked.
      Parameters:
      onMainMenu - The main menu callback.
    • onButtonClicked

      public void onButtonClicked(String buttonId)
      Handles button click events from the GameFinishedView.
      Specified by:
      onButtonClicked in interface ButtonClickObserver
      Parameters:
      buttonId - The ID of the button that was clicked.
    • onButtonClickedWithParams

      public void onButtonClickedWithParams(String buttonId, Map<String,Object> params)
      Handles button click events with parameters. Not directly used by this controller's view but implemented as part of ButtonClickObserver.
      Specified by:
      onButtonClickedWithParams in interface ButtonClickObserver
      Parameters:
      buttonId - The button ID.
      params - The parameters.