Class ItemDefinition

Object
ItemDefinition
All Implemented Interfaces:
Serializable, Ownage

@Entity public class ItemDefinition extends Object implements Serializable, Ownage
The definition of an item. The analogy with Java would be the difference between a class and an object. This is also a factory that creates items based on its itemdefinition, see createItem().
Author:
maartenl
See Also:
  • Constructor Details

    • ItemDefinition

      public ItemDefinition()
    • ItemDefinition

      public ItemDefinition(Long id)
  • Method Details

    • getTitle

      public String getTitle()
    • setTitle

      public void setTitle(String title)
    • getId

      public Long getId()
      Return the id.
      Returns:
      integer containing the identification number of the item definition.
    • setId

      public void setId(Long id)
    • getName

      public String getName()
      Return the noun.
      Returns:
      String containing the noun of the item definition.
    • setName

      public void setName(String name)
    • getAdjectives

      public String getAdjectives()
      Return the first adjective.
      Returns:
      String containing the adjectives of the item definition, for example "dusty grey-fur trimmed long white cloak".
    • setAdjectives

      public void setAdjectives(String adjectives)
    • getManaincrease

      public Integer getManaincrease()
    • setManaincrease

      public void setManaincrease(Integer manaincrease)
    • getHitincrease

      public Integer getHitincrease()
    • setHitincrease

      public void setHitincrease(Integer hitincrease)
    • getVitalincrease

      public Integer getVitalincrease()
    • setVitalincrease

      public void setVitalincrease(Integer vitalincrease)
    • getMovementincrease

      public Integer getMovementincrease()
    • setMovementincrease

      public void setMovementincrease(Integer movementincrease)
    • getEatable

      public String getEatable()
    • setEatable

      public void setEatable(String eatable)
    • getDrinkable

      public String getDrinkable()
    • setDrinkable

      public void setDrinkable(String drinkable)
    • getLightable

      public boolean getLightable()
    • setLightable

      public void setLightable(boolean lightable)
    • getGetable

      public Boolean getGetable()
      You can or cannot retrieve this item.
      Returns:
      true if you can retrieve the item, for example from the floor.
    • setGetable

      public void setGetable(Boolean getable)
    • isBound

      public boolean isBound()
      You cannot transfer this item. It is "soulbound" in warcraft parlance.
      Returns:
      boolean, true if you cannot transfer this item.
    • setBound

      public void setBound(boolean bound)
      You cannot give this item to someone else. Also entails that you cannot drop this item.
      Parameters:
      bound - the new value
    • getDropable

      public Boolean getDropable()
      You can or cannot drop this item
      Returns:
      true if you can drop the item, for example on the floor.
    • setDropable

      public void setDropable(Boolean dropable)
    • getVisible

      public Boolean getVisible()
      Indicates if the item is visible to people.
      Returns:
      true if the item is visible.
    • setVisible

      public void setVisible(Boolean visible)
    • getDescription

      public String getDescription()
      A full and long description of an item. Usually quite a lot of text.
      Returns:
      Long description string.
    • setDescription

      public void setDescription(String description)
    • getReaddescription

      public String getReaddescription()
      Provides the text shown when the item is read. If returns null or empty, it means the item cannot be read.
      Returns:
      String containing the reading.
    • setReaddescription

      public void setReaddescription(String readdescr)
      Set the text to be shown when the item is read. Set to null if the item cannot be read.
      Parameters:
      readdescr - the text shown when reading the item. May be null.
    • getCopper

      public Integer getCopper()
      Return the amount of money, in copper coins, it costs.
      Returns:
      integer containing number of copper coins.
    • setCopper

      public void setCopper(Integer copper)
    • getWeight

      public int getWeight()
    • setWeight

      public void setWeight(int weight)
    • getPasdefense

      public Integer getPasdefense()
    • setPasdefense

      public void setPasdefense(Integer pasdefense)
    • getDamageresistance

      public Integer getDamageresistance()
    • setDamageresistance

      public void setDamageresistance(Integer damageresistance)
    • isContainer

      public boolean isContainer()
      Returns true if this item is a container, i.e. if the item can contain other items or not.
      Returns:
      boolean
      See Also:
    • setContainer

      public void setContainer(Boolean container)
      Indicates that this item should be or should not be a container. Null or false indicates no container, true indicates container.
      Parameters:
      container - Boolean
    • getCreation

      public LocalDateTime getCreation()
      When this item was originally created.
      Returns:
      date
    • setCreation

      public void setCreation(LocalDateTime creation)
    • getCapacity

      public Integer getCapacity()
      The capacity of this container. Indicates how much the container is allowed to carry.
      Returns:
      Integer indicating the capacity.
    • setCapacity

      public void setCapacity(Integer capacity)
    • isOpenable

      public boolean isOpenable()
      Indicates that this container can be opened and closed.
      Returns:
      a boolean if this container can be opened.
      See Also:
    • setOpenable

      public void setOpenable(Boolean isopenable)
    • getKey

      public ItemDefinition getKey()
      Returns the item (the definition to be exact) that can lock/unlock this container. Will be null in most cases.
      Returns:
      the key
    • setKey

      public void setKey(ItemDefinition key)
      Sets the item (the definition to be exact) that can lock/ unlock this container. Can be null.
      Parameters:
      key - the item able to unlock/lock this container.
    • getContaintype

      public Integer getContaintype()
    • setContaintype

      public void setContaintype(Integer containtype)
    • getNotes

      public String getNotes()
    • setNotes

      public void setNotes(String notes)
    • getItemCollection

      public Collection<Item> getItemCollection()
    • setItemCollection

      public void setItemCollection(Collection<Item> itemCollection)
    • getOwner

      public Admin getOwner()
      Description copied from interface: Ownage
      Retrieves the owner, the administrator, of this object. In case this is null, anyone can edit the object.
      Specified by:
      getOwner in interface Ownage
      Returns:
    • setOwner

      public void setOwner(Admin owner)
      Description copied from interface: Ownage
      Sets the owner, the administrator, of this object.
      Specified by:
      setOwner in interface Ownage
      Parameters:
      owner - the owner/administrator of the object. In case this is null, which is allowed, any administrator can edit this object. This is what happens when an object is "disowned".
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getShortDescription

      public String getShortDescription()
      Returns:
      String containing a longdescription of the item, made from concatenating adjectives and the name.
    • getImage

      public String getImage()
    • setImage

      public void setImage(String image)
    • getWieldable

      public Set<Wielding> getWieldable()
    • getWearable

      public Set<Wearing> getWearable()
    • setWearable

      public void setWearable(String set)
    • createItem

      public NormalItem createItem()
      Creates a normal item with this itemdefinition.
      Returns:
      the created item, based on this itemdefinition.
    • setDiscriminator

      public void setDiscriminator(Integer discriminator)
      Parameters:
      discriminator -
      See Also:
    • getDiscriminator

      public Integer getDiscriminator()
      Indicates the type of item. Two values are currently available 0, which is normal, and 1 which is a shop.
      Returns:
      number indicating the discriminator.
    • setWieldable

      public void setWieldable(String wieldable)