|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.maps.MapCommandList
This class keeps track of Commands registered with the map for various commands. It implements the same API for registering commands as the map, and serves as a delegate for those API calls.
Constructor Summary | |
MapCommandList(GameMap map)
|
Method Summary | |
Command |
getCommand(CommandEvent event,
Commandable agent)
Checks the list of Commands who have registered this command with the map, and returns the first one whose rectangle of interest intersects the agent issuing the command. |
void |
registerCommand(java.lang.String command,
Command handler,
Rectangle room)
Registers a command handler in a map. |
void |
unregisterCommand(java.lang.String command,
Command handler,
Rectangle room)
Removes the specified Command from the map's command-list. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MapCommandList(GameMap map)
Method Detail |
public void registerCommand(java.lang.String command, Command handler, Rectangle room)
command
- the command to handlehandler
- the callback object to handle the commandroom
- the map sub-rectangle in which to register
interest. It can be the entire map bounds if the handler
wants to handle the command no matter where the agent is.
The rectangle is clipped against the map bounds, so it's
not an error if it specifies an area outside the map bounds.public void unregisterCommand(java.lang.String command, Command handler, Rectangle room)
command
- the command to unregisterhandler
- the handler to unregisterroom
- the rect to unregisterpublic Command getCommand(CommandEvent event, Commandable agent)
event
- the command event to look for a handler foragent
- the agent doing the command
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |