|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jurpe.items.BasicItem
public abstract class BasicItem
Base class for every PHYSICAL OBJECT of the game, ie: weapons, shields, armors, rings and so on.
Constructor Summary | |
---|---|
BasicItem(ItemType itemType,
java.lang.String oNome,
int oCosto,
int oPeso)
Constructor for wearable/not usable objects |
|
BasicItem(ItemType itemType,
java.lang.String oNome,
int oCosto,
int oPeso,
boolean usable,
boolean wearable)
Generic Constructor |
Method Summary | |
---|---|
java.lang.Object |
clone()
Clone BasicItem. |
int |
compareTo(java.lang.Object rv)
Adds comparability to all derived classes Comparing is always made on cost |
java.lang.String |
getCommonDescription()
Returns cost and weight of an BasicItem. |
int |
getCost()
Returns cost of object |
java.lang.String |
getDescription()
Every object is able to describe himself |
java.lang.String |
getName()
Get the name of the object |
ItemType |
getType()
Returns type of item, such as: BasicItem.WEAPON, BasicItem.ARMOR, BasicItem.SHIELD, BasicItem.OTHER or BasicItem.ITEM. |
int |
getWeight()
Returns weight of object |
boolean |
isItemRandom()
If this item was randomly created |
boolean |
isItemUsable()
If this item is usable (character can use it) |
boolean |
isItemWearable()
If this item is wearable (character can wear it) |
void |
setRandom(boolean rnd)
Set if this item was randomly created |
java.lang.String |
toString()
Object's name |
java.lang.String |
toStringWCost()
Object's name and cost |
void |
unwear(PCharacter pc)
Every object is able to unwear itself |
boolean |
use(PCharacter pc)
Use this object onto given character |
java.lang.String |
warningMessage()
Every time an BasicItem needs to send a message back, this field can be used. |
boolean |
wear(PCharacter pc)
Every object is able to wear itself in the correct position of a character (ie: arms in right hand). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BasicItem(ItemType itemType, java.lang.String oNome, int oCosto, int oPeso)
itemType
- Describes item type. Use BasicItem.WEAPON, BasicItem.ARMOR,
BasicItem.SHIELD, BasicItem.OTHER or BasicItem.ITEMoNome
- Name of objectoCosto
- Cost of objectoPeso
- Weight of objectpublic BasicItem(ItemType itemType, java.lang.String oNome, int oCosto, int oPeso, boolean usable, boolean wearable)
itemType
- Describes item type. Use BasicItem.WEAPON, BasicItem.ARMOR,
BasicItem.SHIELD, BasicItem.OTHER or BasicItem.ITEMoNome
- Name of objectoCosto
- Cost of objectoPeso
- Weight of objectusable
- If this object is usable by a character (ie: potion)wearable
- If this object can be worn by a character (ie: ring)Method Detail |
---|
public int getCost()
public ItemType getType()
public boolean isItemUsable()
public boolean isItemWearable()
public boolean isItemRandom()
public int getWeight()
public java.lang.String getName()
public java.lang.String warningMessage()
public java.lang.String getCommonDescription()
public java.lang.String getDescription()
public boolean wear(PCharacter pc)
pc
- PCharacter who is wearing this object
public void unwear(PCharacter pc)
pc
- PCharacter who is unwearing this objectpublic boolean use(PCharacter pc)
pc
- PCharacter who is using this object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringWCost()
public java.lang.Object clone()
clone
in class java.lang.Object
public int compareTo(java.lang.Object rv)
compareTo
in interface java.lang.Comparable
rv
- Compared BasicItem
public void setRandom(boolean rnd)
rnd
- true if this item has been generated at random
|
Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |