Java Universal Role Playing Engine Version 0.3.9

jurpe.items
Class Item

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

public class Item
extends AbstractItem

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

See Also:
AbstractItem, Serialized Form

Constructor Summary
Item(java.lang.String name, int cost, int weight, java.lang.String description, int mod, java.lang.String attribute, int view, 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 AbstractItem (polymorphic)
 boolean wear(PCharacter pc)
          Polymorphic call to wear this item
 
Methods inherited from class jurpe.items.AbstractItem
canBeWorn, 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,
            int view,
            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)
view - the view radius (in hexagons) of the light, if this is a source of light
wearbool - true if this item is wearable
Method Detail

getDescription

public java.lang.String getDescription()
Long description

Overrides:
getDescription in class AbstractItem
Returns:
Long description

wear

public boolean wear(PCharacter pc)
Polymorphic call to wear this item

Overrides:
wear in class AbstractItem
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 AbstractItem
Parameters:
pc - PCharacter who's going to unwear this armor

use

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

Overrides:
use in class AbstractItem
Parameters:
pc - PCharacter that is going to use this AbstractItem
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

Java Universal Role Playing Engine Version 0.3.9

Copyright ? 2010 http://jurpe.sourceforge.net/ All Rights Reserved.