jurpe.items
Class MoneyBag

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

public class MoneyBag
extends BasicItem

MoneyBag is the representation of an item containing money.

See Also:
Serialized Form

Constructor Summary
MoneyBag(int money)
          Constructor
 
Method Summary
 void addMoney(int amountOfMoney)
          Add money to this money bag
static MoneyBag createRandom(ItemValueType ivt)
          Create a new money bag
 int getAmount()
          Get the amount of money
 java.lang.String getDescription()
          Get the description
 void removeMoney(int amountOfMoney)
          Remove some money from this money bag
 
Methods inherited from class jurpe.items.BasicItem
clone, compareTo, getCommonDescription, getCost, getName, getType, getWeight, isItemRandom, isItemUsable, isItemWearable, setRandom, toString, toStringWCost, unwear, use, warningMessage, wear
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MoneyBag

public MoneyBag(int money)
Constructor

Parameters:
money - How many money this bag contains
Method Detail

getAmount

public int getAmount()
Get the amount of money

Returns:
The amount of money

getDescription

public java.lang.String getDescription()
Get the description

Overrides:
getDescription in class BasicItem
Returns:
String containing object name, cost, weight and other properties.

addMoney

public void addMoney(int amountOfMoney)
Add money to this money bag

Parameters:
amountOfMoney - Amount of money to add

removeMoney

public void removeMoney(int amountOfMoney)
Remove some money from this money bag

Parameters:
amountOfMoney - Money to be removed

createRandom

public static MoneyBag createRandom(ItemValueType ivt)
Create a new money bag

Parameters:
ivt - The value (rare, common...) of this item
Returns:
A new money bag

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