|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrogue.DungeonItem
rogue.Collectable
public class Collectable
A Collectable is an item in the dungeon that can be acquired by the player (or, possibly, by a monster). Its aquisition and consumption will result in changes to the healther and wealth ratings of the acquirer.
| Field Summary |
|---|
| Fields inherited from class rogue.DungeonItem |
|---|
myPosition, theDungeon |
| Constructor Summary | |
|---|---|
Collectable(int ImageNo,
DungeonGame d)
Constructor |
|
| Method Summary | |
|---|---|
int |
health()
Accessor function, returns "health" increment yielded by Collectable item. |
void |
read(java.io.BufferedReader input)
Collectable item uses super.read() to read standard DungeonItem properties, then reads two lines of input file that should contain "healt" and "wealth" numeric values. |
int |
wealth()
Accessor function, returns "wealth" increment yielded by Collectable item. |
| Methods inherited from class rogue.DungeonItem |
|---|
isAt, position, show, vanish |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Collectable(int ImageNo,
DungeonGame d)
ImageNo - identifies image icon used to represent the collectable itemd - Link to dungeon game object| Method Detail |
|---|
public void read(java.io.BufferedReader input)
read in class DungeonIteminput - Reference to BufferedReader connected to dungeon definition file.public int health()
public int wealth()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||