Class RecorderPersistency
java.lang.Object
nz.ac.vuw.ecs.swen225.gp6.persistency.RecorderPersistency
This utility class is responsible for saving and loading recorder timelines for the Recorder
package.
-
Method Summary
Modifier and TypeMethodDescriptionloadTimeline(int slot) Load a timeline from a save slot.static voidsaveTimeline(Stack<Pair<Long, Actions>> timeline, int slot) Save a timeline to a slot.
-
Method Details
-
saveTimeline
Save a timeline to a slot. The associated file exists in res/recordings/[slot].xml- Parameters:
timeline- The timeline to saveslot- The slot to save to- Throws:
IOException- If the file cannot be written to
-
loadTimeline
Load a timeline from a save slot. The associated file exists in res/recordings/[slot].xml- Parameters:
slot- The slot to load from- Returns:
- The loaded timeline
- Throws:
org.dom4j.DocumentException- If the XML document is malformed or cannot be read
-