Module project.pong

Class MainViewController

java.lang.Object
project.pong.controller.MainViewController

public class MainViewController extends Object
The MainViewController class controls the main views and functionalities of the Pong game.
  • Field Details

  • Constructor Details

    • MainViewController

      public MainViewController(MainView mainView, GamePong pong)
      Constructs a MainViewController object with the specified parameters.
      Parameters:
      mainView - The main view.
      pong - The GamePong object.
  • Method Details

    • startView

      public void startView()
      Starts the initial view.
    • getWindowState

      public WindowState getWindowState()
      Gets the current window state.
      Returns:
      The current window state.
    • setWindowState

      public void setWindowState(WindowState windowState)
      Sets the window state.
      Parameters:
      windowState - The window state to set.
    • startSettings

      public void startSettings()
      Starts the settings view.
    • startGame

      public void startGame()
      Starts the game view.
    • startGame

      public void startGame(GameView mainGameView)
      Starts the game view with a specified main game view.
      Parameters:
      mainGameView - The main game view to start.
    • startGameOver

      public void startGameOver()
      Starts the game over view.
    • updateSettings

      public void updateSettings(Options options)
      Updates the game settings.
      Parameters:
      options - The options to update.
    • getPong

      public GamePong getPong()
      Gets the GamePong object.
      Returns:
      The GamePong object.
    • resizeWidth

      public void resizeWidth(double i)
      Resizes the width of the game.
      Parameters:
      i - The amount to resize the width.
    • resizeHeight

      public void resizeHeight(double i)
      Resizes the height of the game.
      Parameters:
      i - The amount to resize the height.
    • saveOptions

      public void saveOptions()
      Saves the game options to a file.
    • loadOptions

      public Options loadOptions()
      Loads the game options from a file.
      Returns:
      The loaded Options object.
    • exit

      public void exit()
      Exits the game.