Class Load
java.lang.Object
nz.ac.vuw.ecs.swen225.gp22.persistency.Load
Used to load levels and resume games.
Using xml files.
- Author:
- Gideon
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcontinueGame(File file, boolean condition) Loads a game from a file if condition is true otherwise loads level 1.static URLClassLoaderreturns the current URLClassLoader.static FileLoads and returns a file using the provided file name.static voidloadLevel(int levelNum) Load level from xml.static voidLoads the previous game if present.static StringParses information about the previous game.static booleanDetermine if there is a previous unfinished level to load.static voidLoad saved game from xml.
-
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
Parses information about the previous game.- Returns:
- a string containing information about the previous game, time passed and keys collected
-
getClassLoader
returns the current URLClassLoader.- Returns:
- the current URLClassLoader
-
continueGame
Loads a game from a file if condition is true otherwise loads level 1.- Parameters:
file- file to load game from if condition is truecondition- if true load game from file
-
getFile
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,
-