com.planet_ink.coffee_mud.Commands
Class Crawl
java.lang.Object
com.planet_ink.coffee_mud.Commands.StdCommand
com.planet_ink.coffee_mud.Commands.Go
com.planet_ink.coffee_mud.Commands.Crawl
- All Implemented Interfaces:
- Command, CMObject, java.lang.Cloneable, java.lang.Comparable<CMObject>
public class Crawl
- extends Go
Constructor Summary |
Crawl()
|
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 |
execute(MOB mob,
java.util.List<java.lang.String> commands,
int metaFlags)
This method actually performs the command, when the given parsed
set of command-line words. |
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. |
boolean |
preExecute(MOB mob,
java.util.List<java.lang.String> commands,
int metaFlags,
int secondsElapsed,
double actionsRemaining)
This method is only called when the mob invoking this command
does not have enough actions to complete it immediately. |
Methods inherited from class com.planet_ink.coffee_mud.Commands.StdCommand |
checkArguments, checkedActionsCost, compareTo, copyOf, executeInternal, I, ID, initializeClass, L, name, newInstance, securityCheck |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Crawl
public Crawl()
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 Go
- Returns:
- the set of command words that the user enters
preExecute
public boolean preExecute(MOB mob,
java.util.List<java.lang.String> commands,
int metaFlags,
int secondsElapsed,
double actionsRemaining)
throws java.io.IOException
- Description copied from interface:
Command
- This method is only called when the mob invoking this command
does not have enough actions to complete it immediately. The
method is called when the command is entered, and every second
afterwards until the invoker has enough actions to complete it.
At completion time, execute is called.
- Specified by:
preExecute
in interface Command
- Overrides:
preExecute
in class StdCommand
- Parameters:
mob
- the player or mob invoking the commandcommands
- the parameters entered for the command (including the trigger word)metaFlags
- flags denoting how the command is being executedsecondsElapsed
- 0 at first, and increments every secondactionsRemaining
- number of free actions the player is defficient.
- Returns:
- whether the command should be allowed to go forward. false cancels altogether.
- Throws:
java.io.IOException
- usually means the player has dropped carrier- See Also:
Command.execute(MOB, List, int)
execute
public boolean execute(MOB mob,
java.util.List<java.lang.String> commands,
int metaFlags)
throws java.io.IOException
- Description copied from interface:
Command
- This method actually performs the command, 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. Some commands have custom APIs however, that allow almost
anything to be in the commands list, or even for the commands to be null.
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 Go
- Parameters:
mob
- the mob or player issueing the commandcommands
- usually the command words and parameters; a set of stringsmetaFlags
- flags denoting how the command is being executed
- Returns:
- whether the command was successfully executed. Is almost meaningless.
- Throws:
java.io.IOException
- usually means the player has dropped carrier- See Also:
Command.actionsCost(MOB, List)
,
Command.securityCheck(MOB)
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 Go
- Parameters:
mob
- the mob executing the command, if anycmds
- 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)
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 anycmds
- 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)
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 Go
- Returns:
- whether this command can be ordered.