Class ItemCategory

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

    public class ItemCategory
    extends Category
    A category is a group that an item can belong to, e.g. "weapons", "luxury goods" etc.
    Version:
    1.0
    Author:
    Andreas
    • Constructor Detail

      • ItemCategory

        public ItemCategory​(StringID id)
        Creates new ItemCategory
      • ItemCategory

        public ItemCategory​(StringID id,
                            Category parent)
        Creates a new ItemCategory object.
    • Method Detail

      • isInstance

        public boolean isInstance​(java.lang.Object o)
        Returns true if o is an ItemType and (transitively) belongs to this category.
        Specified by:
        isInstance in class Category
        Returns:
        true if the top level ancestor of the item type o is a descendant of this, false otherwise, including if o is not an ItemType or null.