Class AbstractReportParser

    • Field Detail

      • log

        protected static final Logger log
      • game

        protected java.lang.String game
      • version

        protected int version
      • firstFaction

        protected Faction firstFaction
      • errors

        protected int errors
      • astral

        protected static java.lang.String astral
      • coordPattern

        protected static java.lang.String coordPattern
      • regionsPattern1

        protected static java.lang.String regionsPattern1
      • regionsPattern2

        protected static java.lang.String regionsPattern2
    • Constructor Detail

      • AbstractReportParser

        public AbstractReportParser()
    • Method Detail

      • originTranslate

        protected CoordinateID originTranslate​(CoordinateID c)
        Translates c by newOrigin if it's in the same z-level and returns it.
      • transformTranslation

        protected CoordinateID transformTranslation​(CoordinateID oldTranslation)
        Transform a coordinate translation: mirror at origin, translate, mirror again.
      • buildPattern

        protected static void buildPattern()
      • originTranslateRegions

        protected java.lang.String originTranslateRegions​(java.lang.String value)
        special sub to translate coords in ";regions" tags of messages expecting this form "x1 y1 z1, x2 y2 z2";regions.
        There is also an older variant: "der Sumpf von Rudros (-7,23)";regions
        value -
      • originTranslate

        protected java.lang.String originTranslate​(java.lang.String value)
        Tries to replace coordinates in string by the translated version. The string is searched for occurrences of the form "(123,123)" or "(123,123,123)" or "(123,123,Astralraum)", transforms them and replaces them. This is not completely fool-proof!
        value - Usually a message text which might contain coordinates
        See Also:
      • getAddFaction

        protected Faction getAddFaction​(EntityID id)
        Helper function: Find a faction in world. If not found, create one and insert it.
      • getAddUnit

        protected Unit getAddUnit​(UnitID id,
                                  boolean old)
        Helper function: Find a unit in world. If not found, create one and insert it.
      • getAddBuilding

        protected Building getAddBuilding​(EntityID id)
        Helper function: Find a building in world. If not found, create one and insert it.
      • getAddShip

        protected Ship getAddShip​(EntityID id)
        Helper function: Find a ship in world. If not found, create one and insert it.
      • getFirstFaction

        public Faction getFirstFaction()
        The first faction encountered while parsing, null if not applicable
      • getErrors

        public int getErrors()