Class JSONParser

    • Field Detail

      • log

        protected static final Logger log
    • Constructor Detail

      • JSONParser

        public JSONParser​(UserInterface ui)
        Creates a new parser.
        Parameters:
        ui - The UserInterface for the progress. Can be NULL. Then no operation is displayed.
      • JSONParser

        public JSONParser​(UserInterface ui,
                          ReportTransformer translator)
        Creates a new parser. This new parser translates coordinates according to newOrigin. All coordinates which are read from the report are translated by newOrigin. That is, if a coordinate read and its level (the z coordinate) equals the new origins level, its x and y coordinates are decreased by origin.x and origin.y, respectively. That means, that the reports origin is transferred to newOrigin.
        Parameters:
        translator - The coordinates (relative to the origin of the report) of the new origin.
    • Method Detail

      • read

        public GameData read​(java.io.Reader in,
                             GameData world)
                      throws java.io.IOException
        Description copied from interface: GameDataIO
        Fills the existing GameData object world from an input Reader of a game data file.
        Specified by:
        read in interface GameDataIO
        Parameters:
        in - A Reader, initialized to an game data file.
        world - An existing GameData.
        Returns:
        The (modified) world
        Throws:
        java.io.IOException - If an I/O error occurs
      • read

        public GameData read​(FileType aFileType,
                             Rules rules)
                      throws java.io.IOException
        Description copied from interface: GameDataIO
        Reads a new GameData object from aFileType.
        Specified by:
        read in interface GameDataIO
        Parameters:
        aFileType - Provides the input file (reader).
        rules - This game is expected to be found.
        Returns:
        a new GameData object, representing the input.
        Throws:
        java.io.IOException - If an I/O error occurs
      • readRules

        public Rules readRules​(FileType filetype)
                        throws java.io.IOException
        Description copied from interface: RulesIO
        Reads the rules from a FileType.
        Specified by:
        readRules in interface RulesIO
        Throws:
        java.io.IOException