public class Misc extends Item
Constructor and Description |
---|
Misc(java.lang.String id,
int value,
int maxStack,
boolean disposable,
boolean currency,
java.lang.String imgName,
Action onUse,
org.newdawn.slick.GameContainer gc)
Miscellaneous item constructor
|
Misc(java.lang.String id,
long serial,
int value,
int maxStack,
boolean disposable,
boolean currency,
java.lang.String imgName,
Action onUse,
org.newdawn.slick.GameContainer gc)
Miscellaneous item constructor (with saved serial number)
|
Modifier and Type | Method and Description |
---|---|
boolean |
isCurrency()
Checks if this items can be treated as currency
|
boolean |
use(Targetable user,
Targetable target)
Activates object on-use action
|
draw, getActionType, getId, getMaxStack, getNumber, getSerialId, getTile, getValue, setOwner, setTile, toString
public Misc(java.lang.String id, int value, int maxStack, boolean disposable, boolean currency, java.lang.String imgName, Action onUse, org.newdawn.slick.GameContainer gc) throws org.newdawn.slick.SlickException, java.io.IOException, java.awt.FontFormatException
id
- Item IDvalue
- Item valuedisposable
- If item disappears after useimgName
- Item image name, for icononUse
- Action on use(ppm click in inventory)gc
- Slick game containerorg.newdawn.slick.SlickException
java.io.IOException
java.awt.FontFormatException
public Misc(java.lang.String id, long serial, int value, int maxStack, boolean disposable, boolean currency, java.lang.String imgName, Action onUse, org.newdawn.slick.GameContainer gc) throws org.newdawn.slick.SlickException, java.io.IOException, java.awt.FontFormatException
id
- Item IDserial
- Saved serial numbervalue
- Item valuedisposable
- If item disappears after useimgName
- Item image name, for icononUse
- Action on use(ppm click in inventory)gc
- Slick game containerorg.newdawn.slick.SlickException
java.io.IOException
java.awt.FontFormatException
public boolean use(Targetable user, Targetable target)
Usable
user
- Object usertarget
- Object user targetpublic boolean isCurrency()