|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Command
A Command is a thing entered on the command line by players. It performs some function, right?
| Field Summary | |
|---|---|
static int |
METAFLAG_AS
constant mask for the metaflags parameter for execute and preexecute, means being forced with AS |
static int |
METAFLAG_FORCED
constant mask for the metaflags parameter for execute and preexecute, means being forced with spells |
static int |
METAFLAG_MPFORCED
constant mask for the metaflags parameter for execute and preexecute, means being mpforced |
static int |
METAFLAG_ORDER
constant mask for the metaflags parameter for execute and preexecute, means being ordered |
static int |
METAFLAG_POSSESSED
constant mask for the metaflags parameter for execute and preexecute, means being possessed |
static int |
METAFLAG_SNOOPED
constant mask for the metaflags parameter for execute and preexecute, means being snooped |
| Method Summary | |
|---|---|
double |
actionsCost(MOB mob,
java.util.Vector 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.Vector cmds)
Returns the number of actions required to completely activate this command. |
boolean |
execute(MOB mob,
java.util.Vector 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.Vector 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 interface com.planet_ink.coffee_mud.core.interfaces.CMObject |
|---|
copyOf, ID, initializeClass, newInstance |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Field Detail |
|---|
static final int METAFLAG_MPFORCED
static final int METAFLAG_ORDER
static final int METAFLAG_POSSESSED
static final int METAFLAG_SNOOPED
static final int METAFLAG_AS
static final int METAFLAG_FORCED
| Method Detail |
|---|
java.lang.String[] getAccessWords()
double actionsCost(MOB mob,
java.util.Vector cmds)
mob - the mob executing the command, if anycmds - the parameters to be passed to the command, if any
combatActionsCost(MOB, Vector)
double combatActionsCost(MOB mob,
java.util.Vector cmds)
mob - the mob executing the command, if anycmds - the parameters to be passed to the command, if any
actionsCost(MOB, Vector)boolean canBeOrdered()
boolean securityCheck(MOB mob)
mob - the player mob who might not even know about this command
boolean execute(MOB mob,
java.util.Vector commands,
int metaFlags)
throws java.io.IOException
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 carrieractionsCost(MOB, Vector),
securityCheck(MOB)
boolean preExecute(MOB mob,
java.util.Vector commands,
int metaFlags,
int secondsElapsed,
double actionsRemaining)
throws java.io.IOException
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.IOExceptionexecute(MOB, Vector, int)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||