Class NRParser

    • Field Detail

      • log

        protected static final Logger log
      • UNIT_MESSAGE_LINE

        protected static final java.lang.String UNIT_MESSAGE_LINE
        See Also:
        Constant Field Values
      • COMBAT_STATUS_PART

        protected static final java.lang.String COMBAT_STATUS_PART
        See Also:
        Constant Field Values
      • GUARD_STATUS_PART

        protected static final java.lang.String GUARD_STATUS_PART
        See Also:
        Constant Field Values
      • ERROR_TYPE

        public static final MessageType ERROR_TYPE
      • MESSAGES_TYPE

        public static final MessageType MESSAGES_TYPE
      • EVENTS_TYPE

        public static final MessageType EVENTS_TYPE
      • idPattern

        protected static java.util.regex.Pattern idPattern
      • id2Pattern

        protected static java.util.regex.Pattern id2Pattern
      • namePattern

        protected static java.util.regex.Pattern namePattern
      • wordPattern

        protected static java.util.regex.Pattern wordPattern
      • eresseaPattern

        protected static java.util.regex.Pattern eresseaPattern
      • atlantisLinePattern

        protected static java.util.regex.Pattern atlantisLinePattern
      • factionLinePattern

        protected static java.util.regex.Pattern factionLinePattern
      • dateLinePattern

        protected static java.util.regex.Pattern dateLinePattern
      • mistakesLinePattern

        protected static java.util.regex.Pattern mistakesLinePattern
      • messageLinePattern

        protected static java.util.regex.Pattern messageLinePattern
      • unitMessageLinePattern

        protected static java.util.regex.Pattern unitMessageLinePattern
      • messagesLinePattern

        protected static java.util.regex.Pattern messagesLinePattern
      • objectPattern

        protected static java.util.regex.Pattern objectPattern
      • object2Pattern

        protected static java.util.regex.Pattern object2Pattern
      • eventsLinePattern

        protected static java.util.regex.Pattern eventsLinePattern
      • sectionLinePattern

        protected static java.util.regex.Pattern sectionLinePattern
      • statusLinePattern

        protected static java.util.regex.Pattern statusLinePattern
      • alliedLinePattern

        protected static java.util.regex.Pattern alliedLinePattern
      • numPattern

        protected static java.util.regex.Pattern numPattern
      • coord2Pattern

        protected static java.util.regex.Pattern coord2Pattern
      • coord3Pattern

        protected static java.util.regex.Pattern coord3Pattern
      • regionLinePattern

        protected static java.util.regex.Pattern regionLinePattern
      • peasantsLinePattern

        protected static java.util.regex.Pattern peasantsLinePattern
      • unitLinePattern

        protected static java.util.regex.Pattern unitLinePattern
      • defaultPartPattern

        protected static java.util.regex.Pattern defaultPartPattern
      • skillsPartPattern

        protected static java.util.regex.Pattern skillsPartPattern
      • skillPartPattern

        protected static java.util.regex.Pattern skillPartPattern
      • itemsPartPattern

        protected static java.util.regex.Pattern itemsPartPattern
      • itemPartPattern

        protected static java.util.regex.Pattern itemPartPattern
      • spellsPartPattern

        protected static java.util.regex.Pattern spellsPartPattern
      • spellPartPattern

        protected static java.util.regex.Pattern spellPartPattern
      • cspellsPartPattern

        protected static java.util.regex.Pattern cspellsPartPattern
      • cspellPartPattern

        protected static java.util.regex.Pattern cspellPartPattern
      • numberPartPattern

        protected static java.util.regex.Pattern numberPartPattern
      • combatStatusPartPattern

        protected static java.util.regex.Pattern combatStatusPartPattern
      • guardStatusPartPattern

        protected static java.util.regex.Pattern guardStatusPartPattern
      • silverPartPattern

        protected static java.util.regex.Pattern silverPartPattern
      • shipLinePattern

        protected static java.util.regex.Pattern shipLinePattern
      • buildingLinePattern

        protected static java.util.regex.Pattern buildingLinePattern
      • oceanType

        protected static StringID oceanType
      • ownerFaction

        protected Faction ownerFaction
      • unmatchedcounter

        protected int unmatchedcounter
      • cSId

        protected int cSId
    • Constructor Detail

      • NRParser

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

        public NRParser​(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 data)
                      throws java.io.IOException
        This function parses the informations found in Reader in and creates a corresponding GameData object tree.
        Specified by:
        read in interface GameDataIO
        Parameters:
        in - Reader to nr file
        data - GameData to be filled with informations of given report file.
        Returns:
        The (modified) world
        Throws:
        java.io.IOException - If an I/O error occurs
        See Also:
        GameDataIO.read(java.io.Reader, magellan.library.GameData)
      • nextLine

        protected final void nextLine()
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • nextLine

        protected void nextLine​(boolean join,
                                boolean skipEmpty)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • continueLine

        protected void continueLine()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • 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