Class BattleInfo


  • public class BattleInfo
    extends java.lang.Object
    Holds parsed info about a battle.
    Author:
    stm
    • Field Detail

      • unknownSkillType

        protected static final SkillType unknownSkillType
      • unknownItemType

        protected static final ItemType unknownItemType
      • spellItemType

        protected static final ItemType spellItemType
      • MAX_ROUND

        public static int MAX_ROUND
        Number of rounds
      • MAX_ROWS

        public static int MAX_ROWS
        Number of rows
      • hostPattern1

        protected java.util.regex.Pattern hostPattern1
      • hostPattern2

        protected java.util.regex.Pattern hostPattern2
      • unitPattern

        protected java.util.regex.Pattern unitPattern
      • skillPattern

        protected java.util.regex.Pattern skillPattern
      • itemPattern

        protected java.util.regex.Pattern itemPattern
      • overviewPattern

        protected java.util.regex.Pattern overviewPattern
      • lastLocale

        protected java.util.Locale lastLocale
    • Constructor Detail

      • BattleInfo

        public BattleInfo​(CoordinateID id,
                          GameData world)
        Initializes an empty battle info.
        Parameters:
        id - Coordinate of the battle
        world -
    • Method Detail

      • createItem

        public Item createItem​(java.lang.String typeName,
                               int amount)
        Constructs an item. Constructs new item type if necessary
      • parse

        public void parse​(Battle b,
                          java.util.Locale locale_)
        Adds information from a battle to this info.
        Parameters:
        b - A battle
        locale_ - locale of the battle report (which usually equals the faction's locale)
      • initPatterns

        protected void initPatterns()
      • getCoordinate

        public CoordinateID getCoordinate()
        Returns the value of coordinate.
        Returns:
        Returns coordinate.
      • setCoordinate

        public void setCoordinate​(CoordinateID coordinate)
        Sets the value of coordinate.
        Parameters:
        coordinate - The value for coordinate.
      • getMaxRound

        public int getMaxRound()
        Returns the value of maxRound.
        Returns:
        Returns maxRound.
      • setMaxRound

        public void setMaxRound​(int maxRound)
        Sets the value of maxRound.
        Parameters:
        maxRound - The value for maxRound.
      • getLocale

        public java.util.Locale getLocale()
        Returns the value of locale.
        Returns:
        Returns locale.
      • setLocale

        public void setLocale​(java.util.Locale locale)
        Sets the value of locale.
        Parameters:
        locale - The value for locale.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toHtml

        public java.lang.String toHtml()
        Creates an HTML string with aggregated data of this battle.
        Returns:
        A string with HTML formatting (without surrounding or tags).
      • toTree

        public void toTree​(javax.swing.tree.DefaultMutableTreeNode parent)
        Creates a tree with aggregated data of thsi battle.
        Parameters:
        parent - all nodes are appended to this node