jurpe.items
Class Item

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

public class Item
extends BasicItem

Item Type Class. An item may be a potion, a necklace, a ring and such...

Author:
Alessio Saltarin
See Also:
BasicItem, Serialized Form

Constructor Summary
Item(java.lang.String name, int cost, int weight, java.lang.String description, int mod, java.lang.String attribute, boolean wearbool)
          Constructor
 
Method Summary
static Item createRandom(ItemValueType value, RandomNames rn)
          Creates a new random item.
 java.lang.String getDescription()
          Long description
static void main(java.lang.String[] args)
          Deprecated.  
 void unwear(PCharacter pc)
          Polymorphic call to unwear this armor
 boolean use(PCharacter pc)
          Use BasicItem (polymorphic)
 boolean wear(PCharacter pc)
          Polymorphic call to wear this item
 
Methods inherited from class jurpe.items.BasicItem
clone, compareTo, getCommonDescription, getCost, getName, getType, getWeight, isItemRandom, isItemUsable, isItemWearable, setRandom, toString, toStringWCost, warningMessage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Item

public Item(java.lang.String name,
            int cost,
            int weight,
            java.lang.String description,
            int mod,
            java.lang.String attribute,
            boolean wearbool)
Constructor

Parameters:
name - Item's name
cost - Item's cost
weight - Item's weight
description - Item's description
mod - int number that applies to Attribute when item is weared or used
attribute - describes what attribute is to be modified with this item (currently HT,DX,IQ,ST)
wearbool - true if this item is wearable
Method Detail

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 item

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

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

use

public boolean use(PCharacter pc)
Use BasicItem (polymorphic)

Overrides:
use in class BasicItem
Parameters:
pc - PCharacter that is going to use this BasicItem
Returns:
true if oggetto was correctly used.

createRandom

public static Item createRandom(ItemValueType value,
                                RandomNames rn)
Creates a new random item.

Parameters:
value - ItemValueType indicating rarity of Item
rn - Handle to current RandomNames object
Returns:
newly created Item
See Also:
ItemValueType

main

public static void main(java.lang.String[] args)
Deprecated. 

Test

Parameters:
args - Arguments

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