java.lang.Object
com.adventure.models.items.Item
- Direct Known Subclasses:
AttackItem
,DefenceItem
,Key
,UsableItem
Class that represents a generic item.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
name
Item name. -
weight
protected int weightItem weight.
-
-
Constructor Details
-
Item
Default constructor- weight: 0
- Parameters:
name
- Name of the item
-
-
Method Details
-
getName
Get the name of the item- Returns:
- name of the item
-
getWeight
public int getWeight()Get the weight of the item- Returns:
- weight of the item
-
setWeight
public void setWeight(int weight) Set the weight of the item- Parameters:
weight
- weight of the item
-
equals
-
hashCode
public int hashCode() -
toString
-