wyvern.lib.commands
Class GiveCommand.GiveEvent
java.lang.Object
wyvern.kernel.properties.PList
wyvern.kernel.commands.EventImpl
wyvern.kernel.commands.TargetedEvent
wyvern.lib.commands.GiveCommand.GiveEvent
- All Implemented Interfaces:
- Broadcaster, CommandEvent, PropertyList
- Enclosing class:
- GiveCommand
- public class GiveCommand.GiveEvent
- extends TargetedEvent
This event class encapsulates the parameters for one monster or
player giving something to another monster or player. The event
exists so that interested listeners can see what's being given, by
whom, to whom, and so on.
- Version:
- 1.0, Jan 22, 1998
- Author:
- Steve Yegge
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_ |
Method Summary |
boolean |
execute()
Executes the transaction by giving the gift to the recipient. |
GameObject |
getGift()
Returns the object being given in the transaction. |
Monster |
getRecipient()
Returns the Monster getting the present. |
protected boolean |
parseArgs(java.lang.String[] argv,
java.lang.String args)
Parse the argument string into a gift and a recipient. |
void |
setGift(GameObject gift)
Sets the thing being given. |
void |
setRecipient(Monster recipient)
Sets the recipient for the gift in the transaction. |
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 |
giftName_
public java.lang.String giftName_
targetName_
public java.lang.String targetName_
target_
public Monster target_
gift_
public GameObject gift_
notEnoughMsg
public java.lang.String notEnoughMsg
GiveCommand.GiveEvent
public GiveCommand.GiveEvent(java.lang.String originalText,
Commandable initialAgent)
- Constructs a new standard GiveEvent.
parseArgs
protected boolean parseArgs(java.lang.String[] argv,
java.lang.String args)
- Parse the argument string into a gift and a recipient.
- Parameters:
args
- the entire argument string
- Returns:
- false if we couldn't parse the args.
setGift
public void setGift(GameObject gift)
- Sets the thing being given.
- Parameters:
gift
- a GameObject to give away
getGift
public GameObject getGift()
- Returns the object being given in the transaction.
- Returns:
- the GameObject being given
setRecipient
public void setRecipient(Monster recipient)
- Sets the recipient for the gift in the transaction.
- Parameters:
recipient
- a Monster with an inventory to receive the object
getRecipient
public Monster getRecipient()
- Returns the Monster getting the present.
- Returns:
- a Monster to receive the thing
execute
public boolean execute()
throws java.lang.Exception
- Executes the transaction by giving the gift to the recipient.
- Throws:
java.lang.Exception