wyvern.lib.commands
Class WhisperCommand.WhisperEvent

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.commands.EventImpl
          extended bywyvern.kernel.commands.TargetedEvent
              extended bywyvern.lib.commands.WhisperCommand.WhisperEvent
All Implemented Interfaces:
Broadcaster, CommandEvent, PropertyList, VerbalEvent
Enclosing class:
WhisperCommand

public class WhisperCommand.WhisperEvent
extends TargetedEvent
implements VerbalEvent

CommandEvent subclass to encapsulate the parameters of the whisper.


Field Summary
protected  java.lang.String message_
           
protected  java.lang.String targetName_
           
 
Fields inherited from class wyvern.kernel.commands.TargetedEvent
cloneError_, location_, quantity_, target_
 
Fields inherited from class wyvern.kernel.commands.EventImpl
agent_, appendToFile_, argString_, argStringParsed_, argv_, argvParsed_, delay_, failureMessage_, filterObjects_, filters_, handler_, map_, modified_, originalText_, playerOriginated_, redirectFile_, redirecting_, sendToAgent_, successMessage_, verb_, vetoed_, wizParsed_
 
Fields inherited from class wyvern.kernel.properties.PList
readOnly_
 
Fields inherited from interface wyvern.lib.PropertyList
PROPERTY_PACKAGE
 
Constructor Summary
WhisperCommand.WhisperEvent(java.lang.String cmd, Commandable agent)
          Constructs a new WhisperEvent.
 
Method Summary
 boolean execute()
          Executes the whisper.
 java.lang.String getMessage()
          Returns the whisper message.
 boolean parseArgs()
          Figures out who we're talking to.
 void setMessage(java.lang.String message)
          Sets the whisper message.
 void whisper(Player agent, Monster target)
          Sends the messages to agent and target.
 
Methods inherited from class wyvern.kernel.commands.TargetedEvent
getCloneErrorMsg, getLocation, getQuantity, getTarget, getTargetName, hasTarget, isQuantified, isTargetSpecifiedByHashcode, setLocation, setQuantified, setQuantity, setTarget, setTargetName
 
Methods inherited from class wyvern.kernel.commands.EventImpl
broadcast, broadcast, broadcast, broadcast, broadcast, checkVeto, fail, filterMessage, findAllMatches, findByHashcode, findInMap, findNeighbor, findObject, findTarget, getAgent, getArgs, getArgString, getDelay, getFailureMessage, getFilterObjects, getFilters, getHandler, getMap, getOriginalText, getRedirectFile, getSuccessMessage, getVerb, hasArgs, isAppending, isModified, isMonster, isPlayer, isPlayerOriginated, isRedirecting, isSendingToAgent, isVetoed, isWizard, main, message, message, noArgs, parseArgString, parseARGV, parseVerb, profileParsing, redirectMessage, runPostHooks, runPreHooks, searchInv, searchInvAndMapNearby, searchInvAndMapUnder, searchInvByHashcode, searchMapNearby, searchMapUnder, searchMapUnderByHashcode, setAgent, setArgs, setDelay, setFailureMessage, setHandler, setMap, setModified, setOriginalText, setPlayerOriginated, setSuccessMessage, setVerb, setVeto, toString, veto
 
Methods inherited from class wyvern.kernel.properties.PList
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, debugProperties, dismantlePropertyList, getDoubleProperty, getInheritedProperty, getInteger, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProfilingInfo, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, transientlyRemoveProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wyvern.lib.PropertyList
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, getDoubleProperty, getInheritedProperty, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, transientlyRemoveProperty
 

Field Detail

message_

protected java.lang.String message_

targetName_

protected java.lang.String targetName_
Constructor Detail

WhisperCommand.WhisperEvent

public WhisperCommand.WhisperEvent(java.lang.String cmd,
                                   Commandable agent)
Constructs a new WhisperEvent.

Parameters:
cmd - whatever the user typed
agent - the person doing the whispering
Method Detail

parseArgs

public boolean parseArgs()
Figures out who we're talking to. Sets the targetName_ and message_ variables.

Returns:
true if a message and target were found

execute

public boolean execute()
Executes the whisper.

Returns:
true if it was successful, false if vetoed or it didn't work for some other reason.

whisper

public void whisper(Player agent,
                    Monster target)
Sends the messages to agent and target.

Parameters:
agent - the player whispering
target - the recipient of the whisper message

getMessage

public java.lang.String getMessage()
Returns the whisper message.

Specified by:
getMessage in interface VerbalEvent
Returns:
whatever is going to be whispered.

setMessage

public void setMessage(java.lang.String message)
Sets the whisper message.

Specified by:
setMessage in interface VerbalEvent
Parameters:
message - the new message to whisper