Class Character

java.lang.Object
  |
  +--Character
Direct Known Subclasses:
NonPlayerCharacter, PlayerCharacter

public class Character
extends java.lang.Object

The Character class defines a base class for characters in the game. This class implements the functionality that is used by all derived classes.

See Also:
NonPlayerCharacter, PlayerCharacter

Constructor Summary
Character()
          Creates an empty base character.
Character(java.lang.String s, Location l, Orientation o)
          Creates a new base character with a name, location and orientation.
 
Method Summary
 void moveTo(Location l)
          Moves the character to a new location.
 void turnTo(Orientation o)
          Turns the character to a new orientation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Character

public Character()
Creates an empty base character.

Character

public Character(java.lang.String s,
                 Location l,
                 Orientation o)
Creates a new base character with a name, location and orientation. This constructor will set up an initial metastate too.
Parameters:
s - name for the new character
l - initial location of the character
o - initial orientation of the character
Method Detail

moveTo

public void moveTo(Location l)
Moves the character to a new location. The current location of the character is updated and the action of moving is viewable through the user interface.

turnTo

public void turnTo(Orientation o)
Turns the character to a new orientation. The current orientation of the character is updated and the action of turning is viewable through the user interface.