net.mazewar
Class Client

java.lang.Object
  extended by net.mazewar.Client
Direct Known Subclasses:
LocalClient, RemoteClient

public abstract class Client
extends java.lang.Object

An abstract class for clients in a maze.

Version:
$Id: Client.java 343 2004-01-24 03:43:45Z geoffw $
Author:
Geoffrey Washburn <geoffw@cis.upenn.edu>

Method Summary
 void addClientListener(ClientListener cl)
          Add an object to be notified when this Client performs an action.
 java.lang.String getName()
          Get the name of this Client.
 Direction getOrientation()
          Find out what direction this Client is presently facing.
 Point getPoint()
          Obtain the location of this Client.
 void registerMaze(Maze maze)
          Register this Client as being contained by the specified Maze.
 void removeClientListener(ClientListener cl)
          Remove an object from the action notification queue.
 void unregisterMaze()
          Inform the Client that it has been taken out of the Maze in which it is located.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerMaze

public void registerMaze(Maze maze)
Register this Client as being contained by the specified Maze. Naturally a Client cannot be registered with more than one Maze at a time.

Parameters:
maze - The Maze in which the Client is being placed.

unregisterMaze

public void unregisterMaze()
Inform the Client that it has been taken out of the Maze in which it is located. The Client must already be registered with a Maze before this can be called.


getName

public java.lang.String getName()
Get the name of this Client.

Returns:
A String naming the Client.

getPoint

public Point getPoint()
Obtain the location of this Client.

Returns:
A Point specifying the location of the Client.

getOrientation

public Direction getOrientation()
Find out what direction this Client is presently facing.

Returns:
A Cardinal Direction.

addClientListener

public void addClientListener(ClientListener cl)
Add an object to be notified when this Client performs an action.

Parameters:
cl - An object that implementing the cl interface.

removeClientListener

public void removeClientListener(ClientListener cl)
Remove an object from the action notification queue.

Parameters:
cl - The ClientListener to remove.