Interface Unit

    • Field Detail

      • GUARDFLAG_TAX

        static final int GUARDFLAG_TAX
        "GUARD TAX" flag (not used any more in modern eressea)
        See Also:
        Constant Field Values
      • GUARDFLAG_MINING

        static final int GUARDFLAG_MINING
        "GUARD MINING" flag (not used any more in modern eressea)
        See Also:
        Constant Field Values
      • GUARDFLAG_WOOD

        static final int GUARDFLAG_WOOD
        "GUARD WOOD" flag (not used any more in modern eressea)
        See Also:
        Constant Field Values
      • GUARDFLAG_TRAVELTHRU

        static final int GUARDFLAG_TRAVELTHRU
        "GUARD TRAVEL" flag (not used any more in modern eressea)
        See Also:
        Constant Field Values
      • GUARDFLAG_LANDING

        static final int GUARDFLAG_LANDING
        "GUARD LANDING" flag (not used any more in modern eressea)
        See Also:
        Constant Field Values
      • GUARDFLAG_CREWS

        static final int GUARDFLAG_CREWS
        "GUARD CREWS" flag (not used any more in modern eressea)
        See Also:
        Constant Field Values
      • GUARDFLAG_RECRUIT

        static final int GUARDFLAG_RECRUIT
        "GUARD RECRUIT" flag (not used any more in modern eressea)
        See Also:
        Constant Field Values
      • GUARDFLAG_PRODUCE

        static final int GUARDFLAG_PRODUCE
        "GUARD PRODUCE" flag (not used any more in modern eressea)
        See Also:
        Constant Field Values
    • Method Detail

      • ordersAreNull

        boolean ordersAreNull()
        Returns true if no orders are set.
      • clearOrders

        void clearOrders()
        Clears the orders and refreshes the relations
      • clearOrders

        @Deprecated
        void clearOrders​(boolean refreshRelations)
        Deprecated.
        relation refreshing is now done event-based
        Clears the orders and possibly refreshes the relations
        Parameters:
        refreshRelations - if true also refresh the relations of the unit.
      • removeOrderAt

        void removeOrderAt​(int i)
        Removes the order at position i and refreshes the relations
      • removeOrderAt

        @Deprecated
        void removeOrderAt​(int i,
                           boolean refreshRelations)
        Deprecated.
        relation refreshing is now done event-based
        Removes the order at position i and possibly refreshes the relations
        Parameters:
        refreshRelations - if true also refresh the relations of the unit.
      • removeOrder

        boolean removeOrder​(java.lang.String order,
                            int length)
        Removes orders that match the given order up to a given length.
        Parameters:
        order - pattern to remove
        length - denotes the number of tokens that need to be equal for a replacement. E.g. specify 2 if order is "BENENNE EINHEIT abc" and all "BENENNE EINHEIT" orders should be replaced but not all "BENENNE" orders.
        Returns:
        true if at least one order was removed
      • removeOrder

        @Deprecated
        boolean removeOrder​(java.lang.String order,
                            int length,
                            boolean refreshRelations)
        Deprecated.
        relation refreshing is now done event-based
        Removes orders that match the given order up to a given length.
        Parameters:
        order - pattern to remove
        length - denotes the number of tokens that need to be equal for a replacement. E.g. specify 2 if order is "BENENNE EINHEIT abc" and all "BENENNE EINHEIT" orders should be replaced but not all "BENENNE" orders.
        refreshRelations -
        Returns:
        true if at least one order was removed
      • replaceOrder

        void replaceOrder​(int pos,
                          Order newOrder)
        Replaces the order at the position by the given new order.
        Parameters:
        pos - An index between 0 and getOrders().getSize() (inclusively)
        newOrder -
      • replaceOrder

        @Deprecated
        void replaceOrder​(int pos,
                          Order newOrder,
                          boolean refreshRelations)
        Deprecated.
        relation refreshing is now done event-based
        Replaces the order at the position by the given new order.
        Parameters:
        pos - An index between 0 and getOrders().getSize() (inclusively)
        newOrder -
      • addOrderAt

        void addOrderAt​(int i,
                        java.lang.String newOrder)
        Adds the order at position i and refreshes the relations
        Parameters:
        i - An index between 0 and getOrders().getSize() (inclusively)
        newOrder -
      • addOrderAt

        @Deprecated
        void addOrderAt​(int i,
                        java.lang.String newOrders,
                        boolean refreshRelations)
        Deprecated.
        relation refreshing is now done event-based
        Adds the order at position i and possibly refreshes the relations
        Parameters:
        i - An index between 0 and getOrders().getSize() (inclusively), or -1 to add at the end
        newOrders -
        refreshRelations - if true also refresh the relations of the unit.
      • addOrders

        void addOrders​(java.util.Collection<java.lang.String> newOrders)
        Adds the orders and refreshes the relations
        Parameters:
        newOrders -
      • addOrders

        @Deprecated
        void addOrders​(java.util.Collection<java.lang.String> newOrders,
                       boolean refreshRelations)
        Deprecated.
        relation refreshing is now done event-based
        Adds the orders and possibly refreshes the relations
        Parameters:
        newOrders -
        refreshRelations - If true also refresh the relations of the unit
      • addOrders2

        void addOrders2​(java.util.Collection<Order> newOrders)
        Adds the orders and refreshes the relations
        Parameters:
        newOrders -
      • addOrders2

        @Deprecated
        void addOrders2​(java.util.Collection<Order> newOrders,
                        boolean refreshRelations)
        Deprecated.
        relation refreshing is now done event-based
        Adds the orders and possibly refreshes the relations
        Parameters:
        newOrders -
        refreshRelations - If true also refresh the relations of the unit
      • setOrders

        void setOrders​(java.util.Collection<java.lang.String> newOrders)
        Sets the orders and refreshes the relations
        Parameters:
        newOrders - my be null
      • setOrders

        @Deprecated
        void setOrders​(java.util.Collection<java.lang.String> newOrders,
                       boolean refreshRelations)
        Deprecated.
        relation refreshing is now done event-based
        Sets the orders and possibly refreshes the relations
        Parameters:
        newOrders - may be null
        refreshRelations - if true also refresh the relations of the unit.
      • setOrders2

        void setOrders2​(java.util.Collection<Order> newOrders)
        Sets the orders and refreshes the relations
        Parameters:
        newOrders - my be null
      • setOrders2

        @Deprecated
        void setOrders2​(java.util.Collection<Order> newOrders,
                        boolean refreshRelations)
        Deprecated.
        relation refreshing is now done event-based
        Sets the orders and possibly refreshes the relations
        Parameters:
        newOrders - my be null
        refreshRelations - if true also refresh the relations of the unit.
      • getOrders

        @Deprecated
        java.util.List<java.lang.String> getOrders()
        Deprecated.
        Delivers a read-only collection of all orders of this unit.
      • getOrders2

        Orders getOrders2()
        Delivers a read-only collection of all orders of this unit.
      • setGroup

        void setGroup​(Group g)
        Sets the group this unit belongs to.
        Parameters:
        g - the group of the unit
      • getGroup

        Group getGroup()
        Returns the group this unit belongs to.
        Returns:
        the group this unit belongs to or null
      • setAlias

        void setAlias​(UnitID id)
        Sets an alias id for this unit.
        Parameters:
        id - the alias id for this unit
      • getAlias

        UnitID getAlias()
        Returns the alias, i.e. the id of this unit it had in the last turn (e.g. after a NUMMER order).
        Returns:
        the alias or null, if the id did not change.
      • getItem

        Item getItem​(ItemType type)
        Returns the item of the specified type if the unit owns such an item, otherwise null.
      • setSpy

        void setSpy​(boolean bool)
        Sets whether is unit really belongs to its unit or only pretends to do so.
      • isSpy

        boolean isSpy()
        Returns whether this unit only pretends to belong to its faction.
        Returns:
        true if the unit is identified as spy
      • setGuiseFaction

        void setGuiseFaction​(Faction f)
        Sets the faction this unit pretends to belong to. A unit cannot disguise itself as a different faction and at the same time be a spy of another faction, therefore, setting a value other than null results in having the spy attribute set to false.
      • getGuiseFaction

        Faction getGuiseFaction()
        Returns the faction this unit pretends to belong to. If the unit is not disguised null is returned.
      • addItem

        Item addItem​(Item i)
        Adds an item to the unit. If the unit already has an item of the same type, the item is overwritten with the specified item object.
        Returns:
        the specified item i.
      • setTempID

        void setTempID​(UnitID id)
        Sets the temp id this unit had before becoming a real unit.
      • getTempID

        UnitID getTempID()
        Returns the id the unit had when it was still a temp unit. This id is only set in the turn after the unit turned from a temp unit into to a real unit.
        Returns:
        the temp id or null, if this unit was no temp unit in the previous turn.
      • setRegion

        void setRegion​(Region r)
        Sets the region this unit is in. If this unit already has a different region set it removes itself from the collection of units in that region.
        Specified by:
        setRegion in interface HasRegion
        Parameters:
        r - the new region, possibly null
      • getRegion

        Region getRegion()
        Returns the region this unit is staying in. Do not assume this to be !=null.
        Specified by:
        getRegion in interface HasRegion
        Returns:
        the region, possibly null
      • setFaction

        void setFaction​(Faction faction)
        Sets the faction for this unit. If this unit already has a different faction set it removes itself from the collection of units in that faction.
      • getFaction

        Faction getFaction()
        Returns the faction this unit belongs to. Do not assume this to be !=null.
      • setBuilding

        void setBuilding​(Building building)
        Sets the building this unit is staying in. If the unit already is in another building this method removes it from the unit collection of that building.
      • getBuilding

        Building getBuilding()
        Returns the building this unit is staying in.
        Returns:
        The building the unit is in, or null
      • setShip

        void setShip​(Ship ship)
        Sets the ship this unit is on. If the unit already is on another ship this method removes it from the unit collection of that ship.
      • getShip

        Ship getShip()
        Returns the ship this unit is on.
        Returns:
        The ship the unit is in, or null
      • setSortIndex

        void setSortIndex​(int index)
        Sets an index indicating how instances of class are sorted in the report.
        Specified by:
        setSortIndex in interface Sorted
      • getSortIndex

        int getSortIndex()
        Returns an index indicating how instances of class are sorted in the report.
        Specified by:
        getSortIndex in interface Sorted
      • setRaceNamePrefix

        void setRaceNamePrefix​(java.lang.String prefix)
        Sets the unit dependent prefix for the race name.
      • getRaceNamePrefix

        java.lang.String getRaceNamePrefix()
        Returns the unit dependent prefix for the race name or null
      • getRaceName

        java.lang.String getRaceName​(GameData data)
        Returns the name of this unit's race including the prefixes of itself, its faction and group if it has such and those prefixes are set.
        Parameters:
        data - The GameData
        Returns:
        the name or null if this unit's race or its name is not set.
      • getSimpleRealRaceName

        java.lang.String getSimpleRealRaceName()
        Returns:
        The String of the RealRace. If no RealRace is known( = null) the normal raceName is returned.
      • getSimpleRaceName

        java.lang.String getSimpleRaceName()
        Delivers the info "typ" from CR without any prefixes and translations used for displaying the according race icon
        Returns:
        Name of the race
      • tempUnits

        java.util.Collection<TempUnit> tempUnits()
        Returns the child temp units created by this unit's orders.
      • getTempUnit

        Unit getTempUnit​(ID key)
        Return the child temp unit with the specified ID.
      • clearTemps

        void clearTemps()
        Clears the list of temp units created by this unit. Clears only the caching collection, does not perform clean-up like deleteTemp() does.
      • getCompleteOrders

        Orders getCompleteOrders()
        Returns all orders including the orders necessary to issue the creation of all the child temp units of this unit.
      • getCompleteOrders

        Orders getCompleteOrders​(boolean writeUnitTagsAsVorlageComment)
        Returns a list of all orders.
        Parameters:
        writeUnitTagsAsVorlageComment -
      • createTemp

        TempUnit createTemp​(GameData data,
                            UnitID key)
        Creates a new temp unit with this unit as the parent. The temp unit is fully initialised, i.e. it is added to the region units collection in the specified game data,it inherits the faction, building or ship, region, faction stealth status, group, race and combat status settings and adds itself to the corresponding unit collections.
        Throws:
        java.lang.IllegalArgumentException
      • deleteTemp

        void deleteTemp​(UnitID key,
                        GameData data)
        Removes a temp unit with this unit as the parent completely from the game data.
      • getRelatedUnits

        void getRelatedUnits​(java.util.Collection<Unit> units)
        Adds all directly related units to units.
      • getRelatedUnits

        void getRelatedUnits​(java.util.Set<Unit> units,
                             java.util.Set<UnitRelation.ID> relations)
        Recursively retrieves all units that are related to this unit via one of the specified relations.
        Parameters:
        units - all units gathered so far to prevent loops.
        relations - a set of classes naming the types of relations that are eligible for regarding a unit as related to some other unit.
      • getModifiedMovement

        java.util.List<CoordinateID> getModifiedMovement()
        Returns a List of the reached coordinates of the units movement starting with the current region or an empty list if unit is not moving.
        Returns:
        A list of coordinates, empty list means no movement. A PAUSE causes two successive occurances of the last region.
      • getModifiedShip

        Ship getModifiedShip()
        Returns the modified ship if this unit modifies the ship
      • getModifiedBuilding

        Building getModifiedBuilding()
        Returns the modified building if this unit modifies it
      • getModifiedSkill

        Skill getModifiedSkill​(SkillType type)
        Returns the modified skills if this will change.
        Parameters:
        type - null is allowed and will yield null as result
      • getModifiedSkills

        java.util.Collection<Skill> getModifiedSkills()
        Returns the skills of this unit as they would appear after the orders for person transfers are processed.
      • getUnitContainer

        UnitContainer getUnitContainer()
        Returns the unit container this belongs to. (ship, building or null)
      • getModifiedUnitContainer

        UnitContainer getModifiedUnitContainer()
        Returns the modified unit container this unit belongs to. (ship, building or null)
      • getSkill

        Skill getSkill​(SkillType type)
        Returns the skill of the specified type if the unit has such a skill, else null is returned.
        Parameters:
        type - null is allowed and will yield null as result
      • getSkill

        Skill getSkill​(StringID type)
        Returns the skill of the specified type if the unit has such a skill, else null is returned.
      • addSkill

        Skill addSkill​(Skill s)
        Adds a skill to unit's collection of skills. If the unit already has a skill of the same type it is overwritten with the the new skill object.
        Returns:
        the specified skill s.
      • getSkills

        java.util.Collection<Skill> getSkills()
        Returns all skills this unit has.
        Returns:
        a collection of Skill objects.
      • getSkillMap

        java.util.Map<StringID,​Skill> getSkillMap()
        Returns the skills of the unit. Changes to the result are reflected in the unit's skills!
      • clearSkills

        void clearSkills()
        Removes all skills from this unit.
      • getItems

        java.util.Collection<Item> getItems()
        Returns all the items this unit possesses.
        Returns:
        a collection of Item objects.
      • getItemMap

        java.util.Map<StringID,​Item> getItemMap()
        Returns the collection of items. Changes to this map are reflected in the unit's items.
      • clearItems

        void clearItems()
        Removes all items from this unit.
      • getModifiedItem

        Item getModifiedItem​(ItemType type)
        Returns the item of the specified type as it would appear after the orders of this unit have been processed, i.e. the amount of the item might be modified by transfer orders. If the unit does not have an item of the specified type nor is given one by some other unit, null is returned.
      • getItemReserveRelations

        java.util.Collection<ReserveRelation> getItemReserveRelations​(ItemType itemType)
        Returns a collection of the reserve relations concerning the given Item.
        Parameters:
        itemType -
        Returns:
        a collection of ReserveRelation objects.
      • getItemTransferRelations

        java.util.List<ItemTransferRelation> getItemTransferRelations​(ItemType type)
        Returns a collection of the itemrelations concerning the given Item.
        Returns:
        a collection of ItemTransferRelation objects.
      • getPersonTransferRelations

        java.util.List<PersonTransferRelation> getPersonTransferRelations()
        Returns a collection of the personrelations associated with this unit
        Returns:
        a collection of PersonTransferRelation objects.
      • getModifiedItems

        java.util.Collection<Item> getModifiedItems()
        Returns the items of this unit as they would appear after the orders of this unit have been processed.
        Returns:
        a collection of Item objects.
      • getPersons

        int getPersons()
        Returns the number of persons in this unit.
      • getModifiedPersons

        int getModifiedPersons()
        Returns the number of persons in this unit as it would be after the orders of this and other units have been processed since it may be modified by transfer orders.
      • getModifiedCombatStatus

        int getModifiedCombatStatus()
        Returns the new combat status of this unit as it would be after the orders of this unit have been processed.
      • getModifiedGuard

        int getModifiedGuard()
        Returns the new (expected) guard value of this unit as it would be after the orders of this unit (and the unit is still allive next turn) (@TODO: do we need a region.getModifiedGuards - List? guess and hope not)
      • getModifiedUnaided

        boolean getModifiedUnaided()
        Returns the new Unaided status of this unit as it would be after the orders of this unit
      • isWeightWellKnown

        boolean isWeightWellKnown()
        Returns:
        true if weight is well known and NOT evaluated by Magellan
      • getSimpleWeight

        int getSimpleWeight()
        Returns the overall weight of this unit (persons and items) in silver if it is known, otherwise -1.
      • getPayloadOnHorse

        @Deprecated
        int getPayloadOnHorse()
        Returns the maximum payload in silver of this unit when it travels by horse. Horses, carts and persons are taken into account for this calculation. If the unit has a sufficient skill in horse riding but there are too many carts for the horses, the weight of the additional carts are also already considered.
        Returns:
        the payload in silver, CAP_NO_HORSES if the unit does not possess horses or CAP_UNSKILLED if the unit is not sufficiently skilled in horse riding to travel on horseback.
      • getPayloadOnFoot

        @Deprecated
        int getPayloadOnFoot()
        Returns the maximum payload in silver of this unit when it travels on foot. Horses, carts and persons are taken into account for this calculation. If the unit has a sufficient skill in horse riding but there are too many carts for the horses, the weight of the additional carts are also already considered. The calculation also takes into account that trolls can tow carts.
        Returns:
        the payload in silver, CAP_UNSKILLED if the unit is not sufficiently skilled in horse riding to travel on horseback.
      • getLoad

        @Deprecated
        int getLoad()
        Returns the weight of all items of this unit that are not horses or carts in silver.
      • getModifiedLoad

        @Deprecated
        int getModifiedLoad()
        Returns the weight of all items of this unit that are not horses or carts in silver based on the modified items.
      • getRadius

        @Deprecated
        int getRadius()
        Returns the number of regions this unit is able to travel within one turn based on the riding skill, horses, carts and load of this unit.
      • getModifiedWeight

        @Deprecated
        int getModifiedWeight()
        Returns the overall weight (persons, items) of this unit in silver based on the modified items and persons.
      • getPassengers

        java.util.Collection<Unit> getPassengers()
        Returns all units this unit is transporting as passengers.
        Returns:
        A Collection of transported Units
      • getCarriers

        java.util.Collection<Unit> getCarriers()
        Returns all units indicating by their orders that they would transport this unit as a passenger (if there is more than one such unit, that is a semantical error of course).
        Returns:
        A Collection of Units carrying this one
      • getPupils

        java.util.Collection<Unit> getPupils()
        Returns a Collection of all the units that are taught by this unit.
        Returns:
        A Collection of Units taught by this unit
      • getTeachers

        java.util.Collection<Unit> getTeachers()
        Returns a Collection of all the units that are teaching this unit.
        Returns:
        A Collection of Units teaching this unit
      • getAttackVictims

        java.util.Collection<Unit> getAttackVictims()
        Returns a list of attacked victims.
      • getAttackAggressors

        java.util.Collection<Unit> getAttackAggressors()
        Returns a list of attackers.
      • refreshRelations

        @Deprecated
        void refreshRelations()
        Deprecated.
        relation refreshing is now done event-based
        Parses the orders of this unit and detects relations between units established by those orders. When does this method have to be called? No relation of a unit can affect an object outside the region that unit is in. So when all relations regarding a certain unit as target or source need to be determined, this method has to be called for each unit in the same region. Since relations are defined by unit orders, modified orders may lead to different relations. Therefore refreshRelations() has to be invoked on a unit after its orders were modified.
      • refreshRelations

        @Deprecated
        void refreshRelations​(int from)
        Deprecated.
        relation refreshing is now done event-based
        Parses the orders of this unit beginning at the fromth order and detects relations between units established by those orders. When does this method have to be called? No relation of a unit can affect an object outside the region that unit is in. So when all relations regarding a certain unit as target or source need to be determined, this method has to be called for each unit in the same region. Since relations are defined by unit orders, modified orders may lead to different relations. Therefore refreshRelations() has to be invoked on a unit after its orders were modified.
        Parameters:
        from - Start from this line
      • toString

        java.lang.String toString()
        Returns a String representation of this unit.
        Overrides:
        toString in class java.lang.Object
      • toString

        java.lang.String toString​(boolean withName)
        Parameters:
        withName -
      • addOrder

        boolean addOrder​(java.lang.String order)
        Add a order to the unit's orders. This function ensures that TEMP units are not affected by the operation.
        Parameters:
        order - the order to add.
      • addOrder

        @Deprecated
        boolean addOrder​(java.lang.String order,
                         boolean refreshRelations)
        Deprecated.
        relation refreshing is now done event-based
        Adds the order and possibly refreshes the relations
        Parameters:
        order - the new order line
        refreshRelations - if true also refresh the relations of the unit.
      • addOrder

        boolean addOrder​(java.lang.String order,
                         boolean replace,
                         int length)
        Add a order to the unit's orders. This function ensures that TEMP units are not affected by the operation.
        Parameters:
        order - the order to add.
        replace - if true, the order replaces any other of the unit's orders of the same type. If false the order is simply added.
        length - denotes the number of tokens that need to be equal for a replacement. E.g. specify 2 if order is "BENENNE EINHEIT abc" and all "BENENNE EINHEIT" orders should be replaced but not all "BENENNE" orders.
        Returns:
        true if the order was successfully added.
      • addOrder

        @Deprecated
        void addOrder​(Order newOrder,
                      boolean refreshRelations)
        Deprecated.
        relation refreshing is now done event-based
        Adds the order and possibly refreshes the relations
        Parameters:
        newOrder -
        refreshRelations - if true also refresh the relations of the unit.
      • addOrderAt

        void addOrderAt​(int i,
                        Order newOrder)
        Adds the order at position i and possibly refreshes the relations
        Parameters:
        i - An index between 0 and getOrders().getSize() (inclusively), or -1 to add at the end
        newOrder -
      • addOrderAt

        @Deprecated
        void addOrderAt​(int i,
                        Order newOrder,
                        boolean refreshRelations)
        Deprecated.
        relation refreshing is now done event-based
        Adds the order at position i and possibly refreshes the relations
        Parameters:
        i - An index between 0 and getOrders().getSize() (inclusively), or -1 to add at the end
        newOrder -
        refreshRelations - if true also refresh the relations of the unit.
      • extractTempUnits

        int extractTempUnits​(GameData data,
                             int tempSortIndex)
        Scans this unit's orders for temp units to create. It constructs them as TempUnit objects and removes the corresponding orders from this unit. Uses the default order locale to parse the orders.
        Parameters:
        tempSortIndex - an index for sorting units (required to reconstruct the original order in the report) which is incremented with each new temp unit.
        Returns:
        the new sort index. return value - sortIndex is the number of temp units read from this unit's orders.
      • extractTempUnits

        int extractTempUnits​(GameData data,
                             int tempSortIndex,
                             java.util.Locale locale)
        Scans this unit's orders for temp units to create. It constructs them as TempUnit objects and removes the corresponding orders from this unit.
        Parameters:
        tempSortIndex - an index for sorting units (required to reconstruct the original order in the report) which is incremented with each new temp unit.
        locale - the locale to parse the orders with.
        Returns:
        the new sort index. return value - sortIndex is the number of temp units read from this unit's orders.
      • getAura

        int getAura()
        Returns the value of aura.
        Returns:
        Returns aura.
      • setAura

        void setAura​(int aura)
        Sets the value of aura.
        Parameters:
        aura - The value for aura.
      • getAuraMax

        int getAuraMax()
        Returns the value of auraMax.
        Returns:
        Returns auraMax.
      • setAuraMax

        void setAuraMax​(int auraMax)
        Sets the value of auraMax.
        Parameters:
        auraMax - The value for auraMax.
      • getCombatSpells

        java.util.Map<ID,​CombatSpell> getCombatSpells()
        Returns the value of combatSpells.
        Returns:
        Returns combatSpells.
      • setCombatSpells

        void setCombatSpells​(java.util.Map<ID,​CombatSpell> combatSpells)
        Sets the value of combatSpells.
        Parameters:
        combatSpells - The value for combatSpells.
      • getCombatStatus

        int getCombatStatus()
        Returns the value of combatStatus.
        Returns:
        Returns combatStatus.
      • setCombatStatus

        void setCombatStatus​(int combatStatus)
        Sets the value of combatStatus.
        Parameters:
        combatStatus - The value for combatStatus.
      • getComments

        java.util.List<java.lang.String> getComments()
        Returns the value of comments.
        Returns:
        Returns comments.
      • setComments

        void setComments​(java.util.List<java.lang.String> comments)
        Sets the value of comments.
        Parameters:
        comments - The value for comments.
      • getEffects

        java.util.List<java.lang.String> getEffects()
        Returns the value of effects.
        Returns:
        Returns effects.
      • setEffects

        void setEffects​(java.util.List<java.lang.String> effects)
        Sets the value of effects.
        Parameters:
        effects - The value for effects.
      • getFamiliarmageID

        ID getFamiliarmageID()
        Returns the value of familiarmageID.
        Returns:
        Returns familiarmageID.
      • setFamiliarmageID

        void setFamiliarmageID​(ID familiarmageID)
        Sets the value of familiarmageID.
        Parameters:
        familiarmageID - The value for familiarmageID.
      • getFollows

        Unit getFollows()
        Returns the value of follows.
        Returns:
        Returns follows.
      • setFollows

        void setFollows​(Unit follows)
        Sets the value of follows.
        Parameters:
        follows - The value for follows.
      • getGuard

        int getGuard()
        Returns the value of guard.
        Original Mail: Das ist was anderes: Je nach Rasse kann Bewachung einen unterschiedlichen Effekt haben. Bergwaechter zum Beispiel bewachen den Abbau von Eisen/Steinen, so dass niemand etwas abbauen kann solange sie das tun, Elfen haben das fuer Holz, usw. Das sieht man allerdings nicht im CR. Folgende defines hat der Server dafuer:
        #define GUARD_TAX 1 /* Verhindert Steuereintreiben *
        #define GUARD_MINING 2 /* Verhindert Bergbau *
        #define GUARD_TREES 4 /* Verhindert Waldarbeiten *
        #define GUARD_TRAVELTHRU 8 /* Blockiert Durchreisende *
        #define GUARD_LANDING 16 /* Verhindert Ausstieg + Weiterreise *
        #define GUARD_CREWS 32 /* Verhindert Unterhaltung auf Schiffen *
        #define GUARD_RECRUIT 64 /* Verhindert Rekrutieren *
        #define GUARD_PRODUCE 128 /* Verhindert Abbau von Resourcen mit RTF_LIMITED *
        Returns:
        Returns guard.
      • setGuard

        void setGuard​(int guard)
        Sets the value of guard.
        Parameters:
        guard - The value for guard.
      • getHealth

        java.lang.String getHealth()
        Returns the value of health.
        Returns:
        Returns health.
      • setHealth

        void setHealth​(java.lang.String health)
        Sets the value of health.
        Parameters:
        health - The value for health.
      • isHideFaction

        boolean isHideFaction()
        Returns the value of hideFaction.
        Returns:
        Returns hideFaction.
      • setHideFaction

        void setHideFaction​(boolean hideFaction)
        Sets the value of hideFaction.
        Parameters:
        hideFaction - The value for hideFaction.
      • isHero

        boolean isHero()
        Returns the value of isHero.
        Returns:
        Returns isHero.
      • setHero

        void setHero​(boolean isHero)
        Sets the value of isHero.
        Parameters:
        isHero - The value for isHero.
      • isStarving

        boolean isStarving()
        Returns the value of isStarving.
        Returns:
        Returns isStarving.
      • setStarving

        void setStarving​(boolean isStarving)
        Sets the value of isStarving.
        Parameters:
        isStarving - The value for isStarving.
      • isOrdersConfirmed

        boolean isOrdersConfirmed()
        Returns the value of ordersConfirmed.
        Returns:
        Returns ordersConfirmed.
      • setOrdersConfirmed

        void setOrdersConfirmed​(boolean ordersConfirmed)
        Sets the value of ordersConfirmed.
        Parameters:
        ordersConfirmed - The value for ordersConfirmed.
      • getPrivDesc

        java.lang.String getPrivDesc()
        Returns the value of privDesc.
        Returns:
        Returns privDesc.
      • setPrivDesc

        void setPrivDesc​(java.lang.String privDesc)
        Sets the value of privDesc.
        Parameters:
        privDesc - The value for privDesc.
      • getRace

        Race getRace()
        Returns race.
        Warning: This should the real race but could be the disguised race!
        Returns:
        Returns race.
      • setRace

        void setRace​(Race race)
        Sets the value of race.
        Parameters:
        race - The value for race.
      • getDisguiseRace

        Race getDisguiseRace()
        Returns the disguised race or null if unit has no race disguise.
        Returns:
        the disguised race or null if unit has no race disguise.
      • setRealRace

        void setRealRace​(Race realRace)
        Sets the value of realRace.
        Parameters:
        realRace - The value for realRace.
      • getSiege

        Building getSiege()
        Returns the value of siege.
        Returns:
        Returns siege.
      • setSiege

        void setSiege​(Building siege)
        Sets the value of siege.
        Parameters:
        siege - The value for siege.
      • getSpells

        java.util.Map<ID,​Spell> getSpells()
        Returns the value of spells.
        Returns:
        Returns spells.
      • setSpells

        void setSpells​(java.util.Map<ID,​Spell> spells)
        Sets the value of spells.
        Parameters:
        spells - The value for spells.
      • getStealth

        int getStealth()
        Returns the value of stealth.
        Returns:
        Returns stealth.
      • setStealth

        void setStealth​(int stealth)
        Sets the value of stealth.
        Parameters:
        stealth - The value for stealth.
      • isUnaided

        boolean isUnaided()
        Returns the value of unaided.
        Returns:
        Returns unaided.
      • setUnaided

        void setUnaided​(boolean unaided)
        Sets the value of unaided.
        Parameters:
        unaided - The value for unaided.
      • getUnitMessages

        java.util.List<Message> getUnitMessages()
        Returns the value of unitMessages.
        Returns:
        Returns unitMessages.
      • setUnitMessages

        void setUnitMessages​(java.util.List<Message> unitMessages)
        Sets the value of unitMessages.
        Parameters:
        unitMessages - The value for unitMessages.
      • setPersons

        void setPersons​(int persons)
        Sets the value of persons.
        Parameters:
        persons - The value for persons.
      • setSkills

        void setSkills​(java.util.Map<StringID,​Skill> skills)
        Sets the value of skills.
        Parameters:
        skills - The value for skills.
      • setWeight

        void setWeight​(int weight)
        Sets the value of weight.
        Parameters:
        weight - The value for weight.
      • setOrderEditor

        void setOrderEditor​(CacheableOrderEditor editor)
        Changes the editor for the unit orders.
        Parameters:
        editor -
      • getPastMovement

        java.util.List<CoordinateID> getPastMovement​(GameData data)
        This function inspects travelthru an travelthruship to find the movement in the past. This might not always be correct, as reconstructing the path from thravelthru messages may be ambigous.
        Returns:
        List of coordinates from start to end region.
      • isPastMovementPassive

        @Deprecated
        boolean isPastMovementPassive()
        Checks if the unit's movement was passive (transported or shipped).
        Returns:
        true if the unit's movement was passive (transported or shipped).
      • isPastMovementPassive

        boolean isPastMovementPassive​(GameSpecificStuff gameSpecificStuff)
        Checks if the unit's movement was passive (transported or shipped).
        Parameters:
        gameSpecificStuff -
        Returns:
        true if the unit's movement was passive (transported or shipped).
      • createOrder

        Order createOrder​(java.lang.String order)
        Parses the given order line and returns a corresponding order.
        Parameters:
        order -
        Returns:
        A new order representing order
      • getData

        GameData getData()
        The game data this unit belongs to.
      • reparseOrders

        void reparseOrders()
        Invoke the order parser again on all orders.
      • getNewRegion

        CoordinateID getNewRegion()
        Returns the modified region, i.e., the region that the unit will be in next round.
      • setNewRegion

        void setNewRegion​(CoordinateID destination)
        Sets the modified region.
      • detach

        void detach()
        Detach a unit from the active report, i.e. remove it from its region, faction and other containers.
      • isDetailsKnown

        boolean isDetailsKnown()
        Returns true iff the all attributes of the unit are known. So it should be true the units of the owner of a server report and false for all others.