java.lang.Object
project.pong.controller.MainViewController
The MainViewController class controls the main views and functionalities of the Pong game.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMainViewController(MainView mainView, GamePong pong) Constructs a MainViewController object with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidexit()Exits the game.getPong()Gets the GamePong object.Gets the current window state.Loads the game options from a file.voidresizeHeight(double i) Resizes the height of the game.voidresizeWidth(double i) Resizes the width of the game.voidSaves the game options to a file.voidsetWindowState(WindowState windowState) Sets the window state.voidStarts the game view.voidStarts the game view with a specified main game view.voidStarts the game over view.voidStarts the settings view.voidStarts the initial view.voidupdateSettings(Options options) Updates the game settings.
-
Field Details
-
gameview
-
-
Constructor Details
-
MainViewController
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
Gets the current window state.- Returns:
- The current window state.
-
setWindowState
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
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
Updates the game settings.- Parameters:
options- The options to update.
-
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
Loads the game options from a file.- Returns:
- The loaded Options object.
-
exit
public void exit()Exits the game.
-