org.haphazard.item
Class GeneralClothes

java.lang.Object
  extended byorg.haphazard.gui.engine.GraphicalObject
      extended byorg.haphazard.item.GeneralItem
          extended byorg.haphazard.item.GeneralClothes

public class GeneralClothes
extends GeneralItem

This class contains all general information about clothes


Field Summary
protected  int mArmorValue
          The protection received from this garment
protected  int mLevel
           
 
Fields inherited from class org.haphazard.item.GeneralItem
mAttackBonus, mDefenceBonus, mRestrictions, mSkill
 
Fields inherited from class org.haphazard.gui.engine.GraphicalObject
id, mDefaultSprite, mDescription, mDescriptionColor, mDescriptionDisplayTime, mDescriptionStartTime, mDimension, mLink, mName, mSpriteDisplayed, mSprites, mWeight
 
Constructor Summary
GeneralClothes()
          Creates a new instance of Clothes
GeneralClothes(java.lang.String name)
          Creates a cloth with a specific name
 
Method Summary
 boolean allows(GeneralClothes clothes)
          Checks if the clothes can be worn together
 int getArmorValue()
          Gets the protectiveness of this clothing
 int getLevel()
          Returns the level of this cloth The level denotes how far out the cloth is worn, a character cannot wear two clothes of the same level
static GraphicalObject loadInstance(java.io.InputStream input)
          Loads an instance of GraphicalObject
 void setArmorValue(int value)
          Sets the protectiveness of this clothing
 void setLevel(int level)
          Sets the level of this cloth
 java.lang.String toXML(int indent)
          Translates this item into an XML notation
 
Methods inherited from class org.haphazard.item.GeneralItem
addContainerSpecialization, addRestriction, equals, getAttackBonus, getContainerDimension, getContainerSpecializations, getContainerSpecializationSlots, getDamageBonus, getDefenceBonus, getRestrictions, hasEdges, hasEdges, isContainer, isContainer, isSolid, isSolid, setContainerDimension, setContainerSpecializationSlots, setDamageBonus
 
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

mArmorValue

protected int mArmorValue
The protection received from this garment


mLevel

protected int mLevel
Constructor Detail

GeneralClothes

public GeneralClothes()
Creates a new instance of Clothes


GeneralClothes

public GeneralClothes(java.lang.String name)
Creates a cloth with a specific name

Parameters:
name - The name of the cloth
Method Detail

getArmorValue

public int getArmorValue()
Gets the protectiveness of this clothing

Returns:
How much this clothing prevents damage

setArmorValue

public void setArmorValue(int value)
Sets the protectiveness of this clothing

Parameters:
value - How protective this clothing is

getLevel

public int getLevel()
Returns the level of this cloth The level denotes how far out the cloth is worn, a character cannot wear two clothes of the same level

Returns:
The level of the cloth

setLevel

public void setLevel(int level)
Sets the level of this cloth

Parameters:
level - The level of the cloth

allows

public boolean allows(GeneralClothes clothes)
Checks if the clothes can be worn together

Parameters:
clothes - The clothes to check against
Returns:
True if they can be worn together

loadInstance

public static GraphicalObject loadInstance(java.io.InputStream input)
Loads an instance of GraphicalObject

Parameters:
input - The input for the stream
Returns:
The loaded graphical object

toXML

public java.lang.String toXML(int indent)
Translates this item into an XML notation

Overrides:
toXML in class GeneralItem
Parameters:
indent - The indentation level
Returns:
The item in XML syntax