|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.mazewar.Maze
public abstract class Maze
An abstract class for representing mazes, and the operations a Client
in the Maze may wish to perform..
| Constructor Summary | |
|---|---|
Maze()
|
|
| Method Summary | |
|---|---|
abstract void |
addClient(Client client)
Add a Client at random location in the Maze. |
abstract void |
addClientAtGivenPoint(Client client,
DirectedPoint directedPoint)
|
abstract void |
addMazeListener(MazeListener ml)
Register an object that wishes to be notified when the maze changes |
abstract boolean |
checkBounds(Point point)
Check whether a Point is within the bounds of the Maze. |
abstract boolean |
clientFire(Client client)
Create a new Projectile from the specified Client |
abstract Cell |
getCell(Point point)
Obtain the Cell corresponding to a given Point in the Maze. |
abstract Direction |
getClientOrientation(Client client)
Find out the cardinal direction a Client is facing. |
abstract Point |
getClientPoint(Client client)
Find out where a specified Client is located
in the Maze. |
abstract java.util.Iterator |
getClients()
Obtain an Iterator over all Clients in the Maze |
abstract Point |
getSize()
Obtain a Point describing the size of the Maze. |
abstract boolean |
moveClientBackward(Client client)
Attempt to move a Client in the Maze backward. |
abstract boolean |
moveClientForward(Client client)
Attempt to move a Client in the Maze forward. |
abstract void |
removeClient(Client client)
Remove the specified Client from the Maze |
abstract void |
removeMazeListener(MazeListener ml)
Remove an object from the notification queue |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Maze()
| Method Detail |
|---|
public abstract Point getSize()
Point describing the size of the Maze.
Point where the method getX returns the maximum X
coordintate, and the method getY returns the maximum Y coordinate.public abstract boolean checkBounds(Point point)
Point is within the bounds of the Maze.
true if the point lies within the Maze, false otherwise.public abstract Cell getCell(Point point)
Cell corresponding to a given Point in the Maze.
point - Location in the Maze.
Cell describing that location.public abstract void addClient(Client client)
Client at random location in the Maze.
client - Client to be added to the Maze.public abstract boolean clientFire(Client client)
Projectile from the specified Client
client - Client that is firing.
false on failure, true on success.public abstract void removeClient(Client client)
Client from the Maze
client - Client to be removed.public abstract Point getClientPoint(Client client)
Client is located
in the Maze.
client - The Client being located.
Point describing the location of the client.public abstract Direction getClientOrientation(Client client)
Client is facing.
client - The Client being queried.
Client as a Direction.public abstract boolean moveClientForward(Client client)
Client in the Maze forward.
client - Client to move.
true if successful, false if failure.public abstract boolean moveClientBackward(Client client)
Client in the Maze backward.
client - Client to move.
true if successful, false if failure.public abstract java.util.Iterator getClients()
Iterator over all Clients in the Maze
Iterator over clients in the Maze.public abstract void addMazeListener(MazeListener ml)
ml - An object implementing the MazeListener interface.public abstract void removeMazeListener(MazeListener ml)
ml - An object implementing the MazeListener interface.
public abstract void addClientAtGivenPoint(Client client,
DirectedPoint directedPoint)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||