|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.commands.TellCommand
Built-in command for executing a "tell".
Nested Class Summary | |
static class |
TellCommand.Tell
Encapsulates a tell, for the "tells" command. |
Field Summary | |
static int |
MAX_TELL_LENGTH
|
Method Summary | |
void |
addCommands(java.util.Map commands,
CommandList list)
Tells the Command to add the commands that it wants to implement into the passed data structure. |
CommandEvent |
createEvent(CommandEvent event)
Creates an event containing the tell info. |
boolean |
execute(CommandEvent event)
Implements the various tell-related commands. |
static TellCommand |
getImpl()
|
static java.util.List |
getTells(Commandable agent)
Returns the list of things the specified agent has been told. |
boolean |
knowsCommand(java.lang.String command)
Returns true if this Command wants to handle the command. |
static void |
playAudibleAlert(Player player)
Plays the tell-beep to a player. |
static java.lang.String |
printTellsList(int num,
java.util.List tells)
Formats the list of tells into a StringBuffer. |
static void |
rememberTell(Commandable recipient,
java.lang.String teller,
java.lang.String message)
Places a Tell object in the recipients "@tells" list. |
boolean |
showTells(CommandEvent event)
Shows the agent the things they've been told. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MAX_TELL_LENGTH
Method Detail |
public static TellCommand getImpl()
public void addCommands(java.util.Map commands, CommandList list)
BuiltInCommand
addCommands
in interface BuiltInCommand
commands
- a Map whose keys are commands, and whose values
are Commands that handle those commands.list
- the CommandList the Command is being added to.public boolean knowsCommand(java.lang.String command)
Command
This method exists to allow more than one game object to implement the same command verb, but with different expected arguments.
If two objects register for the same command and the same arguments, the object that was registered most recently gets to handle at the command.
knowsCommand
in interface Command
command
- the entire command string, including arguments
public CommandEvent createEvent(CommandEvent event)
createEvent
in interface Command
event
- a "blank" CommandEvent containing only the
command text and the agent who's performing the command. This
initial event is created by the originator of the event (e.g.
the AI or player's command preprocessor).
public boolean execute(CommandEvent event)
execute
in interface Command
event
- the CommandEvent to execute
public static void rememberTell(Commandable recipient, java.lang.String teller, java.lang.String message)
public static java.util.List getTells(Commandable agent)
agent
- a player
public boolean showTells(CommandEvent event)
public static java.lang.String printTellsList(int num, java.util.List tells)
num
- the argument, if any: a number, or "all" for
all tells in the list. Can be null, which means "all".tells
- the list of tellspublic static void playAudibleAlert(Player player)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |