|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.haphazard.gui.engine.GraphicalObject org.haphazard.item.GeneralItem
This class contains all general information about items
Field Summary | |
int |
mAttackBonus
|
int |
mDefenceBonus
|
protected java.util.Vector |
mRestrictions
The restrictions of this item |
java.lang.String |
mSkill
|
Fields inherited from class org.haphazard.gui.engine.GraphicalObject |
id, mDefaultSprite, mDescription, mDescriptionColor, mDescriptionDisplayTime, mDescriptionStartTime, mDimension, mLink, mName, mSpriteDisplayed, mSprites, mWeight |
Constructor Summary | |
GeneralItem()
Creates a new item |
|
GeneralItem(java.lang.String name)
Creates a new item with a specific name |
Method Summary | |
void |
addContainerSpecialization(java.lang.String specialization)
Adds an item specialization to this container. |
void |
addRestriction(java.lang.String restriction)
Adds a restriction to this item |
boolean |
equals(java.lang.Object item)
Checks if this item is equal to another item |
int |
getAttackBonus()
Returns the attack bonus of the item |
Dimension3D |
getContainerDimension()
Gets this items containing capacity |
java.util.Vector |
getContainerSpecializations()
Gets all the specializations this item has |
int |
getContainerSpecializationSlots()
Returns the number of items this container can hold |
int |
getDamageBonus()
Gets the items damage bonus The damage bonus is dependant on the items weight and if it is solid and has edges |
int |
getDefenceBonus()
Returns the defence bonus of the item |
java.util.Vector |
getRestrictions()
Gets a vector with the restrictions for equipping this object. |
boolean |
hasEdges()
Checks if the item has edges |
boolean |
hasEdges(boolean hasEdges)
Sets if the item has edges |
boolean |
isContainer()
Checks if this item is a container |
boolean |
isContainer(boolean isContainer)
Sets if this item is a container or not |
boolean |
isSolid()
Checks if the item is solid |
boolean |
isSolid(boolean isSolid)
Sets if the item is solid |
static GraphicalObject |
loadInstance(java.io.InputStream input)
Loads an instance of GraphicalObject |
void |
setContainerDimension(Dimension3D dimension)
Sets the dimension of the container |
void |
setContainerSpecializationSlots(int count)
Sets the number of specialized items the container can hold |
void |
setDamageBonus(int bonus)
Sets the weapons damage bonus |
java.lang.String |
toXML(int indent)
Translates this item into an XML notation |
Methods inherited from class org.haphazard.gui.engine.GraphicalObject |
addSprite, combineSprites, displayDescription, displaySprite, getAvailableSprites, getBoundingBox, getDescription, getDimension, getName, getNotResettedSprite, getResettedSprite, getWeight, isDefaultSpriteDisplayed, load, optimize, paintComponent, resetDisplayedSprite, save, setDefaultSprite, setDefaultSprite, setDescription, setDimension, setName, setWeight, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public java.lang.String mSkill
public int mAttackBonus
public int mDefenceBonus
protected java.util.Vector mRestrictions
Constructor Detail |
public GeneralItem()
public GeneralItem(java.lang.String name)
name
- The name to gice the itemMethod Detail |
public boolean hasEdges(boolean hasEdges)
hasEdges
- true if the item has edges
public boolean hasEdges()
public boolean isSolid(boolean isSolid)
isSolid
- True if the item should be solid
public boolean isSolid()
public java.util.Vector getRestrictions()
public void addRestriction(java.lang.String restriction)
restriction
- The restriction to addgetRestrictions()
public int getDamageBonus()
public void setDamageBonus(int bonus)
bonus
- The bonus to setpublic int getAttackBonus()
public int getDefenceBonus()
public void setContainerDimension(Dimension3D dimension)
dimension
- The dimension to setpublic Dimension3D getContainerDimension()
public void addContainerSpecialization(java.lang.String specialization)
specialization
- The type of item to specialize inpublic java.util.Vector getContainerSpecializations()
public void setContainerSpecializationSlots(int count)
count
- The number of specialized items the container can holdpublic int getContainerSpecializationSlots()
public boolean isContainer(boolean isContainer)
isContainer
- True if this item should be a container
public boolean isContainer()
public static GraphicalObject loadInstance(java.io.InputStream input)
input
- The input for the stream
public boolean equals(java.lang.Object item)
item
- The item to check against
public java.lang.String toXML(int indent)
toXML
in class GraphicalObject
indent
- The indentation level
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |