Class Cache


  • public class Cache
    extends java.lang.Object
    A class for caching data that is time consuming to compute or wasteful to allocate but frequently needed. Objects of this type are available in units and in all UnitContainer subclasses. If fields are added, please comment on where the field is used and with wich scope!
    • Field Detail

      • modifiedName

        public java.lang.String modifiedName
        used in Unit and UnitContainer for modified name
      • relations

        public java.util.List<UnitRelation> relations
        used in Unit and UnitContainer for relations between or to units
      • modifiedSkills

        public java.util.Map<StringID,​Skill> modifiedSkills
        used in Unit for skills after person transfers and recruiting !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT: do not modify this thing (except for assignments) since it may point to the Unit.skills map!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      • modifiedItems

        public java.util.Map<StringID,​Item> modifiedItems
        DOCUMENT-ME
      • unitWeight

        @Deprecated
        public int unitWeight
        Deprecated.
        currently unused
      • modifiedUnitWeight

        @Deprecated
        public int modifiedUnitWeight
        Deprecated.
        currently unused
      • modifiedPersons

        public int modifiedPersons
        number of persons after orders
      • modifiedCombatStatus

        public int modifiedCombatStatus
        The expected combat status at beginning next turn acording to actual orders If cache is not calculated, status is EresseaConstants.CS_INIT;
      • modifiedGuard

        public int modifiedGuard
        guard status after orders
      • modifiedUnaided

        public boolean modifiedUnaided
        The expected unaided - status at beginning next turn acording to actual orders cache status is detected with modifiedUnaidedValidated
      • modifiedUnaidedValidated

        public boolean modifiedUnaidedValidated
        just a checker, if modifiedUnaided was already validated
      • modifiedContainerUnits

        public java.util.Map<EntityID,​Unit> modifiedContainerUnits
        used in UnitContainer !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT: do not modify this thing (except for assignments) since it may point to the UnitContainer.units map!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      • regionItems

        @Deprecated
        public java.util.Map<ID,​Item> regionItems
        Deprecated.
        replaced by method in Units
        Used in Region for creating a list of Items of priviliged factions in the region
      • allRegionItems

        @Deprecated
        public java.util.Map<ID,​Item> allRegionItems
        Deprecated.
        replaced by method in Units
        Used in Region for creating a list of Items of all factions in the region
      • movementPath

        public java.util.List<CoordinateID> movementPath
        Used in Unit (FIXME(pavkovic): right now used in PathCellRenderer) to store movement information extracted from travelThru (-Ship) and faction messages
      • movementPathIsPassive

        public java.lang.Boolean movementPathIsPassive
        DOCUMENT-ME
    • Constructor Detail

      • Cache

        public Cache()
    • Method Detail

      • addHandler

        public void addHandler​(CacheHandler h)
        Register a CacheHandler.
        Parameters:
        h -
      • removeHandler

        public void removeHandler​(CacheHandler h)
        Un-register a CacheHandler.
        Parameters:
        h -
      • clear

        public void clear()
        Clears all members of this Cache.