com.planet_ink.coffee_mud.Commands
Class Drop

java.lang.Object
  extended by com.planet_ink.coffee_mud.Commands.StdCommand
      extended by com.planet_ink.coffee_mud.Commands.Drop
All Implemented Interfaces:
Command, CMObject, java.lang.Cloneable, java.lang.Comparable<CMObject>
Direct Known Subclasses:
Empty

public class Drop
extends StdCommand


Field Summary
 
Fields inherited from class com.planet_ink.coffee_mud.Commands.StdCommand
ID, noCoinFilter
 
Constructor Summary
Drop()
           
 
Method Summary
 double actionsCost(MOB mob, java.util.List<java.lang.String> cmds)
          Returns the number of actions required to completely activate this command.
 boolean canBeOrdered()
          Whether the a group leader or charmer can order their followers to do this command.
 double combatActionsCost(MOB mob, java.util.List<java.lang.String> cmds)
          Returns the number of actions required to completely activate this command.
 boolean drop(MOB mob, Environmental dropThis, boolean quiet, boolean optimize, boolean intermediate)
           
 boolean execute(MOB mob, java.util.List<java.lang.String> commands, int metaFlags)
          This method actually performs the drop, when the given parsed set of command-line words.
 java.lang.Object executeInternal(MOB mob, int metaFlags, java.lang.Object... args)
          This method is used for making "insider" calls to the command.
 java.lang.String[] getAccessWords()
          Returns the set of command words, with the most public one first, that are entered by the user to initiate this command.
 
Methods inherited from class com.planet_ink.coffee_mud.Commands.StdCommand
checkArguments, checkedActionsCost, compareTo, copyOf, I, ID, initializeClass, L, name, newInstance, preExecute, securityCheck
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Drop

public Drop()
Method Detail

getAccessWords

public java.lang.String[] getAccessWords()
Description copied from interface: Command
Returns the set of command words, with the most public one first, that are entered by the user to initiate this command.

Specified by:
getAccessWords in interface Command
Overrides:
getAccessWords in class StdCommand
Returns:
the set of command words that the user enters

drop

public boolean drop(MOB mob,
                    Environmental dropThis,
                    boolean quiet,
                    boolean optimize,
                    boolean intermediate)

execute

public boolean execute(MOB mob,
                       java.util.List<java.lang.String> commands,
                       int metaFlags)
                throws java.io.IOException
This method actually performs the drop, when the given parsed set of command-line words. The commands list is almost always the set of strings, starting with the access word that triggered the command. This command does have a custom API however, that allows an Item, and two Boolean objects to be substitued for the normal command strings. This method is not allowed to be called until the player or mob has satisfied the actionsCost requirements and the securityCheck

Specified by:
execute in interface Command
Overrides:
execute in class StdCommand
Parameters:
mob - the mob or player issueing the command
commands - usually the command words and parameters; a set of strings
metaFlags - flags denoting how the command is being executed
Returns:
whether the command was successfully executed. true if it was successfully dropped, false otherwise
Throws:
java.io.IOException - usually means the player has dropped carrier
See Also:
Command.actionsCost(MOB, List), Command.securityCheck(MOB)

combatActionsCost

public double combatActionsCost(MOB mob,
                                java.util.List<java.lang.String> cmds)
Description copied from interface: Command
Returns the number of actions required to completely activate this command. A value of 0.0 means perform instantly. This method only applies when the user is fighting in combat.

Specified by:
combatActionsCost in interface Command
Overrides:
combatActionsCost in class StdCommand
Parameters:
mob - the mob executing the command, if any
cmds - the parameters to be passed to the command, if any
Returns:
the number of player free actions required to do this
See Also:
Command.actionsCost(MOB, List), Command.checkedActionsCost(MOB, List)

actionsCost

public double actionsCost(MOB mob,
                          java.util.List<java.lang.String> cmds)
Description copied from interface: Command
Returns the number of actions required to completely activate this command. A value of 0.0 means perform instantly. This method only applies when the user is not in combat.

Specified by:
actionsCost in interface Command
Overrides:
actionsCost in class StdCommand
Parameters:
mob - the mob executing the command, if any
cmds - the parameters to be passed to the command, if any
Returns:
the number of player free actions required to do this
See Also:
Command.combatActionsCost(MOB, List), Command.checkedActionsCost(MOB, List)

canBeOrdered

public boolean canBeOrdered()
Description copied from interface: Command
Whether the a group leader or charmer can order their followers to do this command.

Specified by:
canBeOrdered in interface Command
Overrides:
canBeOrdered in class StdCommand
Returns:
whether this command can be ordered.

executeInternal

public java.lang.Object executeInternal(MOB mob,
                                        int metaFlags,
                                        java.lang.Object... args)
                                 throws java.io.IOException
Description copied from interface: Command
This method is used for making "insider" calls to the command. It's parameters and implementation can follow any rules you like. The engine will sometimes use these to make direct calls to the command implementations.

Specified by:
executeInternal in interface Command
Overrides:
executeInternal in class StdCommand
Parameters:
mob - the mob or player issueing the command
metaFlags - flags denoting how the command is being executed
args - a set of object parameters
Returns:
a object response
Throws:
java.io.IOException - usually means the player has dropped carrier