org.haphazard.character.body
Class Arm

java.lang.Object
  extended byorg.haphazard.character.body.BodyPart
      extended byorg.haphazard.character.body.Arm

public class Arm
extends BodyPart

An implementation of an arm.


Field Summary
 
Fields inherited from class org.haphazard.character.body.BodyPart
mClothes, mSlots
 
Constructor Summary
Arm()
          Creates a new instance of Arm
Arm(java.lang.String name)
          Creates an instance of an arm with a specific name
Arm(java.lang.String name, boolean primary)
          Creates an arm with a name and denotes if it is an primary arm or not
 
Method Summary
 Item getItem()
          Gets the item held in this hand
 javax.swing.tree.DefaultMutableTreeNode getTreeNode()
          Gets a node view over every thing in this bodypart
 boolean isPrimary()
          Checks if this arm is a primary arm
 void setItem(Item item)
          Sets the item held in this hand
 void setPrimary(boolean isPrimary)
          Sets that the arm is a primary arm
 java.lang.String toXML(int indent)
          Transforms this object into an XML-notation
 
Methods inherited from class org.haphazard.character.body.BodyPart
addWound, canWear, getAllClothes, getArmorValue, getCritical, getLocation, getName, getPenalty, getWound, heal, isHit, isWearing, setName, setNaturalArmor, setToHit, status, toString, undress, wear, wound
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Arm

public Arm()
Creates a new instance of Arm


Arm

public Arm(java.lang.String name)
Creates an instance of an arm with a specific name

Parameters:
name - The name of the bodypart

Arm

public Arm(java.lang.String name,
           boolean primary)
Creates an arm with a name and denotes if it is an primary arm or not

Parameters:
name - The name of the part
primary - If the part is primary or not
Method Detail

isPrimary

public boolean isPrimary()
Checks if this arm is a primary arm

Overrides:
isPrimary in class BodyPart
Returns:
True if it is

setPrimary

public void setPrimary(boolean isPrimary)
Sets that the arm is a primary arm

Parameters:
isPrimary - True if the arm is primary

getItem

public Item getItem()
Gets the item held in this hand

Returns:
The item held, null if no item

setItem

public void setItem(Item item)
Sets the item held in this hand

Parameters:
item - The item to hold

getTreeNode

public javax.swing.tree.DefaultMutableTreeNode getTreeNode()
Gets a node view over every thing in this bodypart

Overrides:
getTreeNode in class BodyPart
Returns:
A tree node to be displayed

toXML

public java.lang.String toXML(int indent)
Transforms this object into an XML-notation

Overrides:
toXML in class BodyPart
Parameters:
indent - The indentation level to use
Returns:
The object in an XML notation