|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrogue.DungeonItem
rogue.ActiveItem
rogue.Player
public class Player
class Player An instance of this class acts as the user's "avatar" in the game. The data file must define a Player object and specify its initial position.
| Field Summary |
|---|
| Fields inherited from class rogue.ActiveItem |
|---|
myHealth |
| Fields inherited from class rogue.DungeonItem |
|---|
myPosition, theDungeon |
| Constructor Summary | |
|---|---|
Player(DungeonGame d)
Constructor It invokes super constructor (i.e. |
|
| Method Summary | |
|---|---|
void |
getHit(int damage)
Record wounding of Player by monster |
void |
read(java.io.BufferedReader input)
Invokes super.read (ActiveItem) to read standard data such as location and health rating, then reads "strength" parameter of Player. |
void |
run()
Defines run behaviour of Player - check for an input command (numeric key), if there is input, invoke the performMovementCommand() function. |
| Methods inherited from class rogue.ActiveItem |
|---|
alive, move, step |
| 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 Player(DungeonGame d)
d - Reference to dungeon game object| Method Detail |
|---|
public void read(java.io.BufferedReader input)
read in class ActiveIteminput - BufferedReader connected to dungeon definition filepublic void run()
public void getHit(int damage)
getHit in class ActiveItemdamage - Amount of damage done by monster's attack
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||