Package nz.ac.vuw.ecs.swen225.gp6.app
Class App
java.lang.Object
nz.ac.vuw.ecs.swen225.gp6.app.App
Main class of the application. Includes the main method, GUI, and the main loop.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the current configuration.Gets the current controller.getGame()Gets the current game.Gets the current game clock.getGUI()Gets the gui object.Gets the current Recorder.Gets the current Replay.getSave(int slot) Gets a saved game indicated by the save slot.voidInitializes the GUI and displays menu screen.booleanReturns if the game is in resume mode or not.voidRefreshes the saved games array.voidFunction to invoke the losing sequence.voidFunction to invoke the winning sequence, it also handles the transition to the next level.voidsetResuming(boolean isResuming) Sets the game to be in resuming mode or not.voidSets the game to a new game and enters game play mode.voidstartSavedGame(int slot) Sets the game to a saved game and enters game play mode.voidstartSavedReplay(int slot) Sets the game to a saved game and enters replay mode.voidTransitions to the game screen.
-
Constructor Details
-
App
public App()Constructor for the App class. Initializes the GUI and the main loop.
-
-
Method Details
-
initialiseGui
public void initialiseGui()Initializes the GUI and displays menu screen. -
runWinEvent
public void runWinEvent()Function to invoke the winning sequence, it also handles the transition to the next level. -
runLoseEvent
public void runLoseEvent()Function to invoke the losing sequence. -
transitionToGameScreen
public void transitionToGameScreen()Transitions to the game screen. -
startNewGame
public void startNewGame()Sets the game to a new game and enters game play mode. -
startSavedGame
public void startSavedGame(int slot) Sets the game to a saved game and enters game play mode.- Parameters:
slot- the save file to load
-
startSavedReplay
public void startSavedReplay(int slot) Sets the game to a saved game and enters replay mode.- Parameters:
slot- the save file to load
-
refreshSaves
public void refreshSaves()Refreshes the saved games array. -
getGame
Gets the current game.- Returns:
- the game object
-
getController
Gets the current controller.- Returns:
- the controller object
-
getConfiguration
Gets the current configuration.- Returns:
- the Configuration object
-
getGameClock
Gets the current game clock.- Returns:
- the game clock object
-
getRecorder
Gets the current Recorder.- Returns:
- the recorder object
-
getReplay
Gets the current Replay.- Returns:
- the replay object
-
getGUI
Gets the gui object.- Returns:
- the GUI object
-
isResuming
public boolean isResuming()Returns if the game is in resume mode or not.- Returns:
- true if in resume mode, false otherwise
-
setResuming
public void setResuming(boolean isResuming) Sets the game to be in resuming mode or not.- Parameters:
isResuming- true if in resume mode, false otherwise
-
getSave
Gets a saved game indicated by the save slot.- Parameters:
slot- which save slot to access- Returns:
- The corresponding game save
-