Class SaveObject


  • public final class SaveObject
    extends java.lang.Object
    NEW This classes job is to hold all the data needed to reconstruct the game state Its the object that will be written using serilisation to a file
    • Constructor Summary

      Constructors 
      Constructor Description
      SaveObject()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void readXML​(java.lang.String path)
      Loads a saved game which is an XML file
      static void writeXMl​(java.lang.String path)
      A method which saves the Game to XML using a STAX parser
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SaveObject

        public SaveObject()
    • Method Detail

      • writeXMl

        public static void writeXMl​(java.lang.String path)
        A method which saves the Game to XML using a STAX parser
        Parameters:
        path - The path to where the file will be saved
      • readXML

        public static void readXML​(java.lang.String path)
        Loads a saved game which is an XML file
        Parameters:
        path - the path to the XML file that the method will load