Java Universal Role Playing Engine Version 0.3.9

jurpe.items
Class MoneyBag

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

public class MoneyBag
extends AbstractItem

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.AbstractItem
canBeWorn, 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 AbstractItem
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

Java Universal Role Playing Engine Version 0.3.9

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