Class App

java.lang.Object
nz.ac.vuw.ecs.swen225.gp6.app.App

public class App extends Object
Main class of the application. Includes the main method, GUI, and the main loop.
  • 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

      public Domain getGame()
      Gets the current game.
      Returns:
      the game object
    • getController

      public Controller getController()
      Gets the current controller.
      Returns:
      the controller object
    • getConfiguration

      public Configuration getConfiguration()
      Gets the current configuration.
      Returns:
      the Configuration object
    • getGameClock

      public GameClock getGameClock()
      Gets the current game clock.
      Returns:
      the game clock object
    • getRecorder

      public Record getRecorder()
      Gets the current Recorder.
      Returns:
      the recorder object
    • getReplay

      public Replay getReplay()
      Gets the current Replay.
      Returns:
      the replay object
    • getGUI

      public GUI 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

      public Domain getSave(int slot)
      Gets a saved game indicated by the save slot.
      Parameters:
      slot - which save slot to access
      Returns:
      The corresponding game save