Class Player

java.lang.Object
  extended by Player

public class Player
extends java.lang.Object

This class represents players in the game. Each player has a current location.

Version:
2011.07.31
Author:
Michael Kolling and David J. Barnes

Field Summary
private  Room currentRoom
           
 
Constructor Summary
Player()
          Constructor for objects of class Player
 
Method Summary
 Room getCurrentRoom()
          Return the current room for this player.
 void setCurrentRoom(Room room)
          Set the current room for this player.
 void walk(java.lang.String direction)
          Try to walk in a given direction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentRoom

private Room currentRoom
Constructor Detail

Player

public Player()
Constructor for objects of class Player

Method Detail

getCurrentRoom

public Room getCurrentRoom()
Return the current room for this player.


setCurrentRoom

public void setCurrentRoom(Room room)
Set the current room for this player.


walk

public void walk(java.lang.String direction)
Try to walk in a given direction. If there is a door this will change the player's location.