Class ItemDefinition
Object
ItemDefinition
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a normal item with this itemdefinition.boolean
Return the first adjective.The capacity of this container.Return the amount of money, in copper coins, it costs.When this item was originally created.A full and long description of an item.Indicates the type of item.You can or cannot drop this itemYou can or cannot retrieve this item.getId()
Return the id.getImage()
getKey()
Returns the item (the definition to be exact) that can lock/unlock this container.boolean
getName()
Return the noun.getNotes()
getOwner()
Retrieves the owner, the administrator, of this object.Provides the text shown when the item is read.See for more informationOutputFormatter.getDescriptionOfItem(String, String, boolean)
.getTitle()
Indicates if the item is visible to people.int
int
hashCode()
boolean
isBound()
You cannot transfer this item.boolean
Returns true if this item is a container, i.e.boolean
Indicates that this container can be opened and closed.void
setAdjectives
(String adjectives) void
setBound
(boolean bound) You cannot give this item to someone else.void
setCapacity
(Integer capacity) void
setContainer
(Boolean container) Indicates that this item should be or should not be a container.void
setContaintype
(Integer containtype) void
void
setCreation
(LocalDateTime creation) void
setDamageresistance
(Integer damageresistance) void
setDescription
(String description) void
setDiscriminator
(Integer discriminator) void
setDrinkable
(String drinkable) void
setDropable
(Boolean dropable) void
setEatable
(String eatable) void
setGetable
(Boolean getable) void
setHitincrease
(Integer hitincrease) void
void
void
setItemCollection
(Collection<Item> itemCollection) void
setKey
(ItemDefinition key) Sets the item (the definition to be exact) that can lock/ unlock this container.void
setLightable
(boolean lightable) void
setManaincrease
(Integer manaincrease) void
setMovementincrease
(Integer movementincrease) void
void
void
setOpenable
(Boolean isopenable) void
Sets the owner, the administrator, of this object.void
setPasdefense
(Integer pasdefense) void
setReaddescription
(String readdescr) Set the text to be shown when the item is read.void
void
setVisible
(Boolean visible) void
setVitalincrease
(Integer vitalincrease) void
setWearable
(String set) void
setWeight
(int weight) void
setWieldable
(String wieldable) toString()
-
Constructor Details
-
ItemDefinition
public ItemDefinition() -
ItemDefinition
-
-
Method Details
-
getTitle
-
setTitle
-
getId
Return the id.- Returns:
- integer containing the identification number of the item definition.
-
setId
-
getName
Return the noun.- Returns:
- String containing the noun of the item definition.
-
setName
-
getAdjectives
Return the first adjective.- Returns:
- String containing the adjectives of the item definition, for example "dusty grey-fur trimmed long white cloak".
-
setAdjectives
-
getManaincrease
-
setManaincrease
-
getHitincrease
-
setHitincrease
-
getVitalincrease
-
setVitalincrease
-
getMovementincrease
-
setMovementincrease
-
getEatable
-
setEatable
-
getDrinkable
-
setDrinkable
-
getLightable
public boolean getLightable() -
setLightable
public void setLightable(boolean lightable) -
getGetable
You can or cannot retrieve this item.- Returns:
- true if you can retrieve the item, for example from the floor.
-
setGetable
-
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
You can or cannot drop this item- Returns:
- true if you can drop the item, for example on the floor.
-
setDropable
-
getVisible
Indicates if the item is visible to people.- Returns:
- true if the item is visible.
-
setVisible
-
getDescription
A full and long description of an item. Usually quite a lot of text.- Returns:
- Long description string.
-
setDescription
-
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
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
Return the amount of money, in copper coins, it costs.- Returns:
- integer containing number of copper coins.
-
setCopper
-
getWeight
public int getWeight() -
setWeight
public void setWeight(int weight) -
getPasdefense
-
setPasdefense
-
getDamageresistance
-
setDamageresistance
-
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
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
-
setCreation
-
getCapacity
The capacity of this container. Indicates how much the container is allowed to carry.- Returns:
- Integer indicating the capacity.
-
setCapacity
-
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
-
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
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
-
setContaintype
-
getNotes
-
setNotes
-
getItemCollection
-
setItemCollection
-
getOwner
-
setOwner
Description copied from interface:Ownage
Sets the owner, the administrator, of this object. -
hashCode
-
equals
-
toString
-
getShortDescription
See for more informationOutputFormatter.getDescriptionOfItem(String, String, boolean)
.- Returns:
- String containing a longdescription of the item, made from concatenating adjectives and the name.
-
getImage
-
setImage
-
getWieldable
-
getWearable
-
setWearable
-
createItem
Creates a normal item with this itemdefinition.- Returns:
- the created item, based on this itemdefinition.
-
setDiscriminator
- Parameters:
discriminator
-- See Also:
-
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
-