java.lang.Object
nz.ac.vuw.ecs.swen225.gp22.persistency.Load

public class Load extends Object
Used to load levels and resume games. Using xml files.
Author:
Gideon
  • Constructor Details

    • Load

      public Load()
  • Method Details

    • resumeGame

      public static void resumeGame()
      Load saved game from xml. Open fileChooser.
    • loadLevel

      public static void loadLevel(int levelNum)
      Load level from xml.
      Parameters:
      levelNum - level to load.
    • previousGamePresent

      public static boolean previousGamePresent()
      Determine if there is a previous unfinished level to load.
      Returns:
      true if there is an unfinished level false otherwise.
    • previousGame

      public static void previousGame()
      Loads the previous game if present. If there is no previous game present loads level1. returns the time passed in the previous game.
    • previousGameInfo

      public static String previousGameInfo()
      Parses information about the previous game.
      Returns:
      a string containing information about the previous game, time passed and keys collected
    • getClassLoader

      public static URLClassLoader getClassLoader()
      returns the current URLClassLoader.
      Returns:
      the current URLClassLoader
    • continueGame

      public static void continueGame(File file, boolean condition)
      Loads a game from a file if condition is true otherwise loads level 1.
      Parameters:
      file - file to load game from if condition is true
      condition - if true load game from file
    • getFile

      public static File getFile(String file)
      Loads and returns a file using the provided file name.
      Parameters:
      file - fileName to find
      Returns:
      The File that was found associated with the provided name,