|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.planet_ink.coffee_mud.Commands.StdCommand
public class StdCommand
Field Summary | |
---|---|
protected java.lang.String |
ID
|
protected static Filterer<Environmental> |
noCoinFilter
|
Constructor Summary | |
---|---|
StdCommand()
|
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. |
boolean |
checkArguments(java.lang.Class[][] fmt,
java.lang.Object... args)
|
double |
checkedActionsCost(MOB mob,
java.util.List<java.lang.String> cmds)
Returns the number of actions required to completely activate this command. |
double |
combatActionsCost(MOB mob,
java.util.List<java.lang.String> cmds)
Returns the number of actions required to completely activate this command. |
int |
compareTo(CMObject o)
|
CMObject |
copyOf()
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed. |
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.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. |
static java.lang.String[] |
I(java.lang.String[] str)
|
java.lang.String |
ID()
The CoffeeMud Java Class ID shared by all instances of this object. |
void |
initializeClass()
Called ONCE after all objects are loaded, but before the map is read in during initialization. |
java.lang.String |
L(java.lang.String str,
java.lang.String... xs)
|
java.lang.String |
name()
The displayable name of this object. |
CMObject |
newInstance()
Returns a new instance of this class. |
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. |
boolean |
securityCheck(MOB mob)
Whether this command is available to the given player |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.lang.String ID
protected static final Filterer<Environmental> noCoinFilter
Constructor Detail |
---|
public StdCommand()
Method Detail |
---|
public java.lang.String ID()
CMObject
ID
in interface CMObject
public java.lang.String name()
CMObject
name
in interface CMObject
Environmental.Name()
public java.lang.String[] getAccessWords()
Command
getAccessWords
in interface Command
public void initializeClass()
CMObject
initializeClass
in interface CMObject
public java.lang.String L(java.lang.String str, java.lang.String... xs)
public static java.lang.String[] I(java.lang.String[] str)
public boolean execute(MOB mob, java.util.List<java.lang.String> commands, int metaFlags) throws java.io.IOException
Command
execute
in interface Command
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
java.io.IOException
- usually means the player has dropped carrierCommand.actionsCost(MOB, List)
,
Command.securityCheck(MOB)
public boolean preExecute(MOB mob, java.util.List<java.lang.String> commands, int metaFlags, int secondsElapsed, double actionsRemaining) throws java.io.IOException
Command
preExecute
in interface Command
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.
java.io.IOException
- usually means the player has dropped carrierCommand.execute(MOB, List, int)
public java.lang.Object executeInternal(MOB mob, int metaFlags, java.lang.Object... args) throws java.io.IOException
Command
executeInternal
in interface Command
mob
- the mob or player issueing the commandmetaFlags
- flags denoting how the command is being executedargs
- a set of object parameters
java.io.IOException
- usually means the player has dropped carrierpublic boolean checkArguments(java.lang.Class[][] fmt, java.lang.Object... args)
public double actionsCost(MOB mob, java.util.List<java.lang.String> cmds)
Command
actionsCost
in interface Command
mob
- the mob executing the command, if anycmds
- the parameters to be passed to the command, if any
Command.combatActionsCost(MOB, List)
,
Command.checkedActionsCost(MOB, List)
public double combatActionsCost(MOB mob, java.util.List<java.lang.String> cmds)
Command
combatActionsCost
in interface Command
mob
- the mob executing the command, if anycmds
- the parameters to be passed to the command, if any
Command.actionsCost(MOB, List)
,
Command.checkedActionsCost(MOB, List)
public double checkedActionsCost(MOB mob, java.util.List<java.lang.String> cmds)
Command
checkedActionsCost
in interface Command
mob
- the mob executing the command, if anycmds
- the parameters to be passed to the command, if any
Command.combatActionsCost(MOB, List)
,
Command.actionsCost(MOB, List)
public boolean canBeOrdered()
Command
canBeOrdered
in interface Command
public boolean securityCheck(MOB mob)
Command
securityCheck
in interface Command
mob
- the player mob who might not even know about this command
public CMObject newInstance()
CMObject
newInstance
in interface CMObject
public CMObject copyOf()
CMObject
copyOf
in interface CMObject
public int compareTo(CMObject o)
compareTo
in interface java.lang.Comparable<CMObject>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |