jurpe.items
Class Armor

java.lang.Object
  extended by jurpe.items.BasicItem
      extended by jurpe.items.Armor
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

public class Armor
extends BasicItem

Armor Type.

Author:
Alessio Saltarin
See Also:
BasicItem, Serialized Form

Constructor Summary
Armor(java.lang.String name, int cost, int weight, int aDp, int aRd)
          Constructor
 
Method Summary
static Armor createRandom(ItemValueType value, RandomNames rn)
          Creates a random generated Armor
 java.lang.String getDescription()
          Long description
 int getDR()
          Get Damage Resistance
 int getPD()
          Get Passive Defense
 void unwear(PCharacter pc)
          Polymorphic call to unwear this armor
 boolean wear(PCharacter pc)
          Polymorphic call to wear this armor (BasicItem)
 
Methods inherited from class jurpe.items.BasicItem
clone, compareTo, getCommonDescription, getCost, getName, getType, getWeight, isItemRandom, isItemUsable, isItemWearable, setRandom, toString, toStringWCost, use, warningMessage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Armor

public Armor(java.lang.String name,
             int cost,
             int weight,
             int aDp,
             int aRd)
Constructor

Parameters:
name - Armor's name
cost - Armor's cost
weight - Armor's weight
aDp - Armor's Passive Defense
aRd - Armor's Damage Resistance
Method Detail

createRandom

public static Armor createRandom(ItemValueType value,
                                 RandomNames rn)
Creates a random generated Armor

Parameters:
value - ItemValueType indicating rarity of Item
rn - Handle to Random Names
Returns:
newly created Shield

getDescription

public java.lang.String getDescription()
Long description

Overrides:
getDescription in class BasicItem
Returns:
Long description

wear

public boolean wear(PCharacter pc)
Polymorphic call to wear this armor (BasicItem)

Overrides:
wear in class BasicItem
Parameters:
pc - PCharacter who's going to wear this Armor
Returns:
True, if Armor is correctly worn

unwear

public void unwear(PCharacter pc)
Polymorphic call to unwear this armor

Overrides:
unwear in class BasicItem
Parameters:
pc - PCharacter who's going to unwear this armor

getPD

public int getPD()
Get Passive Defense

Returns:
Passive Defense of this Armor

getDR

public int getDR()
Get Damage Resistance

Returns:
Damage Resistance of this Armor

Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net