Class Save
java.lang.Object
nz.ac.vuw.ecs.swen225.gp22.persistency.Save
Used to save the current game.
Using xml files.
- Author:
- Gideon
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addPoint
(org.dom4j.Element element, Maze.Point p) Add an x and y as attributes to an xml element.static void
saveGame()
Save current game as xml.static void
saveInventory
(org.dom4j.Element player) Save inventory to xml element.
-
Constructor Details
-
Save
public Save()
-
-
Method Details
-
saveGame
public static void saveGame()Save current game as xml. Store information about the map, dimensions, number of treasures, nextLevel. Store time and keysCollected. Store player position, direction and inventory if present. Store tilemap. -
saveInventory
public static void saveInventory(org.dom4j.Element player) Save inventory to xml element.- Parameters:
player
- Element to add the inventory to.
-
addPoint
Add an x and y as attributes to an xml element.- Parameters:
element
- Element to add the attributes to.p
- Point to get the x and y from.
-