|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.motion.TeleportCommand
This Command handles hookable teleport events.
NOTE: If you register with a map (via a map, room or proximity hook) for "teleportPostHook", to tell when someone has left the map by teleporting, you won't ever get called. This is because the game kernel runs the map hook using the agent's map after the command is processed, which for teleporting is a different map. There are two (somewhat cumbersome) possible workarounds:
(A possible engine-level workaround is to have the TeleportCommand be on its own teleportPostHook somehow, and run the post-hook on both the starting and ending maps.)
Method Summary | |
void |
addCommands(java.util.Map commands,
CommandList list)
Adds commands. |
CommandEvent |
createEvent(CommandEvent event)
Creates an event to encapsulate the wizard typing "teleport map|player [ |
boolean |
execute(CommandEvent event)
Teleports the agent. |
static TeleportCommand |
getImpl()
|
static boolean |
goingToOtherWorkroom(java.lang.String name,
java.lang.String path)
Returns true if the destination is a workroom *other* than the agent's workroom. |
boolean |
handleBack(CommandEvent event)
Executes the "back" command, taking the wizard back to whichever map they were in before they last typed "goto <map>". |
boolean |
knowsCommand(java.lang.String command)
Built-in commands return true for this method. |
static void |
main(java.lang.String[] args)
Tests the pattern-matching stuff. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static TeleportCommand getImpl()
public void addCommands(java.util.Map commands, CommandList list)
addCommands
in interface BuiltInCommand
list
- the CommandList we're being added tocommands
- the map to add our commands topublic boolean knowsCommand(java.lang.String command)
knowsCommand
in interface Command
command
- the command to check
public CommandEvent createEvent(CommandEvent event)
createEvent
in interface Command
event
- the event containing the initial arguments
public boolean execute(CommandEvent event)
execute
in interface Command
event
- the CommandEvent with the args & properties
relevant to a teleport command.
public static boolean goingToOtherWorkroom(java.lang.String name, java.lang.String path)
name
- the agent's namepath
- the path to the destination map
public boolean handleBack(CommandEvent event)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |