Class ItemType

  • All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Comparable<java.lang.Object>, Identifiable, Named, Unique

    public class ItemType
    extends ObjectType
    Stores rule relevant info about types of items, like "Holz".
    • Constructor Detail

      • ItemType

        public ItemType​(StringID id)
        Creates a new ItemType object.
    • Method Detail

      • setWeight

        public void setWeight​(float w)
        Sets the items weight in GE.
      • getWeight

        public float getWeight()
        Returns the items weight in GE.
      • setMakeSkill

        public void setMakeSkill​(Skill s)
        Sets the skill needed to MAKE this item.
      • getMakeSkill

        public Skill getMakeSkill()
        Returns the skill needed to MAKE this item.
      • setUseSkill

        public void setUseSkill​(Skill s)
        Sets the skill needed to use this item (e.g. a weapon skill).
      • getUseSkill

        public Skill getUseSkill()
        Returns the skill needed to use this item (e.g. a weapon skill).
      • setCategory

        public void setCategory​(ItemCategory c)
        Sets the items category.
      • getCategory

        public ItemCategory getCategory()
        Returns the items category. May return null.
      • addResource

        public void addResource​(Item i)
        Adds an item to the set of resources needed to make this ItemType.
      • getResources

        public java.util.Iterator<Item> getResources()
        Returns the set of resources needed to MAKE this ItemType or null if there are none.
      • getResource

        public Item getResource​(StringID id)
        Returns the resource of this type belonging to the id or null if the id doesn't belong to the resources.
      • getIcon

        public java.lang.String getIcon()
        Returns the file name of the icon to use for this item.
        Overrides:
        getIcon in class ObjectType
      • setIcon

        public void setIcon​(java.lang.String iName)
        Sets the file name of the icon to use for this item.
        Overrides:
        setIcon in class ObjectType
      • getOrderName

        public java.lang.String getOrderName()
        Returns:
        name quoted if required
      • setStoreableInBonw

        public void setStoreableInBonw​(int bonw)
        store the attribute if the item can be stored in a bag of negative weight
      • isStoreableInBonw

        public boolean isStoreableInBonw()
        Returns:
        the status if an item can be stored in a bag of negative weight
      • isHorse

        public boolean isHorse()
        Returns true if this type is a horse.
      • setHorse

        public void setHorse​(short horse)
        Sets the horse property.