Class GameSelectionController

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

public class GameSelectionController extends Object implements ButtonClickObserver
GameSelectionController

This class is responsible for controlling the game selection view. It implements ButtonClickObserver.

See Also:
  • Constructor Details

    • GameSelectionController

      public GameSelectionController(GameSelectionView view)
      Constructor for the GameSelectionController.
      Parameters:
      view - The view to control.
  • Method Details

    • setOnLadderGame

      public void setOnLadderGame(Runnable onLadderGame)
      Sets the callback to run when the ladder game is selected.
      Parameters:
      onLadderGame - The ladder game callback.
    • setOnLudoGame

      public void setOnLudoGame(Runnable onLudoGame)
      Sets the callback to run when the ludo game is selected.
      Parameters:
      onLudoGame - The ludo game callback.
    • onButtonClicked

      public void onButtonClicked(String buttonId)
      Handles the button click event.
      Specified by:
      onButtonClicked in interface ButtonClickObserver
      Parameters:
      buttonId - The button ID.
    • onButtonClickedWithParams

      public void onButtonClickedWithParams(String buttonId, Map<String,Object> params)
      Handles the button click event with parameters.
      Specified by:
      onButtonClickedWithParams in interface ButtonClickObserver
      Parameters:
      buttonId - The button ID.
      params - The parameters.