Class RecorderPersistency

java.lang.Object
nz.ac.vuw.ecs.swen225.gp6.persistency.RecorderPersistency

public final class RecorderPersistency extends Object
This utility class is responsible for saving and loading recorder timelines for the Recorder package.
  • Method Details

    • saveTimeline

      public static void saveTimeline(Stack<Pair<Long,Actions>> timeline, int slot) throws IOException
      Save a timeline to a slot. The associated file exists in res/recordings/[slot].xml
      Parameters:
      timeline - The timeline to save
      slot - The slot to save to
      Throws:
      IOException - If the file cannot be written to
    • loadTimeline

      public static Stack<Pair<Long,Actions>> loadTimeline(int slot) throws org.dom4j.DocumentException
      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