com.planet_ink.coffee_mud.core.interfaces
Interface MUDCmdProcessor

All Known Subinterfaces:
Deity, MOB
All Known Implementing Classes:
Alligator, AngryCitizen, Ape, Assassin, Beaver, Bee, BlackBear, BlackDragon, BlueDragon, BrassDragon, BronzeDragon, BrownBear, BrownSnake, Buck, Buffalo, Bugbear, Bull, Cat, Centaur, Centipede, Cheetah, Chicken, Chimp, Citizen, Cobra, CommonBat, CopperDragon, Cougar, Cow, Coyote, Crocodile, Deer, DireWolf, Doe, Dog, Dolphin, Doppleganger, Dragon, DrowElf, DrowPriestess, DrowWarrior, DrowWizard, Duck, Elephant, Falcon, FireGiant, FlyingInsect, Fox, Frog, FrostGiant, GardenSnake, GenAuctioneer, GenBanker, GenCow, GenDeity, GenHorse, GenLibrarian, GenMob, GenPostman, GenRideable, GenShopkeeper, GenUndead, GiantBat, GiantScorpion, Gnoll, Goat, GoatDoe, Goblin, GoldDragon, Gorilla, GreenDragon, Hawk, HeavenlyServent, HillGiant, Hornet, Horse, InvisibleStalker, Jaguar, Kitten, LargeBat, Lion, Lizard, LizardMan, LizardManShaman, Minotaur, Monkey, MountainLion, Mouse, Naga, Ogre, Orc, Owl, Panther, Parakeet, Pegasus, PegasusGreater, Penguin, Pig, Puppy, Python, Rabbit, Rat, Rattlesnake, Raven, RedDragon, Scorpion, Seal, Shark, Sheep, SilverDragon, Skeleton, Snake, Spider, Squirrel, StdAuctioneer, StdBanker, StdDeity, StdFactoryMOB, StdLibrarian, StdMOB, StdPostman, StdRideable, StdShopKeeper, StoneGiant, StoneGolem, Swordfish, Teacher, Tiger, Toad, Troll, Turtle, UmberHulk, Undead, Vulture, Walrus, Whale, WhiteBear, WhiteDragon, WildEagle, Wolf, Wolverine, Worm, Wyvern, Zombie

public interface MUDCmdProcessor

Something that is capable of taking user-entered commands, parsing them, and then executing them.


Field Summary
static int METAFLAG_AS
          constant mask for the metaflags parameter for execute and preexecute, means being forced with AS
static int METAFLAG_ASMESSAGE
          constant mask for the metaflags parameter for execute and preexecute, means being a meta-command
static int METAFLAG_FORCED
          constant mask for the metaflags parameter for execute and preexecute, means being forced with spells
static int METAFLAG_INORDER
          constant mask for the metaflags parameter for execute and preexecute, means always after prev command
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 actions()
          Returns the number of action points that this processor has to spend towards performing any commands, skills, or whatever needs action points to be spent on them.
 void clearCommandQueue()
          Cancels and empties the command que of this processor.
 int commandQueSize()
          Returns the number of commands on this processors que
 boolean dequeCommand()
          If this processor has enough action points to perform the top command on the que, then this method will execute that action.
 void doCommand(java.util.List<java.lang.String> commands, int metaFlags)
          Forces this processor to parse the given command string tokens, determine a command to execute, and then execute it, regardless of whether there are any action points remaining.
 void enqueCommand(java.util.List<java.lang.String> commands, int metaFlags, double actionCost)
          Parses the given command string tokens to determine what kind of command is to be executed, and depending on how many actions the player has remaining this tick, either executes the command or puts it on the que for automatic execution once sufficient actions are available.
 void enqueCommands(java.util.List<java.util.List<java.lang.String>> commands, int metaFlags)
          Parses the given commands string tokens to determine what kind of commands are to be executed, and depending on how many actions the player has remaining this tick, either executes the commands or puts them on the que for automatic execution once sufficient actions are available.
 void prequeCommand(java.util.List<java.lang.String> commands, int metaFlags, double actionCost)
          Parses the given command string tokens to determine what kind of command is to be executed, and depending on how many actions the player has remaining this tick, either executes the command or puts it on the que for automatic execution once sufficient actions are available.
 void prequeCommands(java.util.List<java.util.List<java.lang.String>> commands, int metaFlags)
          Parses the given command string tokens to determine what kind of command is to be executed, and depending on how many actions the player has remaining this tick, either executes the command or puts it on the que for automatic execution once sufficient actions are available.
 void setActions(double remain)
          Sets the number of action points that this processor has to spend towards performing any commands, skills, or whatever needs action points to be spent on them.
 

Field Detail

METAFLAG_MPFORCED

static final int METAFLAG_MPFORCED
constant mask for the metaflags parameter for execute and preexecute, means being mpforced

See Also:
Constant Field Values

METAFLAG_ORDER

static final int METAFLAG_ORDER
constant mask for the metaflags parameter for execute and preexecute, means being ordered

See Also:
Constant Field Values

METAFLAG_POSSESSED

static final int METAFLAG_POSSESSED
constant mask for the metaflags parameter for execute and preexecute, means being possessed

See Also:
Constant Field Values

METAFLAG_SNOOPED

static final int METAFLAG_SNOOPED
constant mask for the metaflags parameter for execute and preexecute, means being snooped

See Also:
Constant Field Values

METAFLAG_AS

static final int METAFLAG_AS
constant mask for the metaflags parameter for execute and preexecute, means being forced with AS

See Also:
Constant Field Values

METAFLAG_FORCED

static final int METAFLAG_FORCED
constant mask for the metaflags parameter for execute and preexecute, means being forced with spells

See Also:
Constant Field Values

METAFLAG_ASMESSAGE

static final int METAFLAG_ASMESSAGE
constant mask for the metaflags parameter for execute and preexecute, means being a meta-command

See Also:
Constant Field Values

METAFLAG_INORDER

static final int METAFLAG_INORDER
constant mask for the metaflags parameter for execute and preexecute, means always after prev command

See Also:
Constant Field Values
Method Detail

enqueCommand

void enqueCommand(java.util.List<java.lang.String> commands,
                  int metaFlags,
                  double actionCost)
Parses the given command string tokens to determine what kind of command is to be executed, and depending on how many actions the player has remaining this tick, either executes the command or puts it on the que for automatic execution once sufficient actions are available.

Parameters:
commands - the parsed command string tokens
metaFlags - meta-command flags to send to the command, if any
actionCost - either 0 to let the action object decide, or an override cost
See Also:
dequeCommand(), clearCommandQueue(), doCommand(List, int), actions()

enqueCommands

void enqueCommands(java.util.List<java.util.List<java.lang.String>> commands,
                   int metaFlags)
Parses the given commands string tokens to determine what kind of commands are to be executed, and depending on how many actions the player has remaining this tick, either executes the commands or puts them on the que for automatic execution once sufficient actions are available.

Parameters:
commands - the parsed commands string tokens
metaFlags - meta-command flags to send to the command, if any
See Also:
dequeCommand(), clearCommandQueue(), doCommand(List, int), actions()

prequeCommand

void prequeCommand(java.util.List<java.lang.String> commands,
                   int metaFlags,
                   double actionCost)
Parses the given command string tokens to determine what kind of command is to be executed, and depending on how many actions the player has remaining this tick, either executes the command or puts it on the que for automatic execution once sufficient actions are available.

Parameters:
commands - the parsed command string tokens
metaFlags - meta-command flags to send to the command, if any
actionCost - either 0 to let the action object decide, or an override cost
See Also:
dequeCommand(), clearCommandQueue(), doCommand(List, int), actions()

prequeCommands

void prequeCommands(java.util.List<java.util.List<java.lang.String>> commands,
                    int metaFlags)
Parses the given command string tokens to determine what kind of command is to be executed, and depending on how many actions the player has remaining this tick, either executes the command or puts it on the que for automatic execution once sufficient actions are available.

Parameters:
commands - the parsed command string tokens
metaFlags - meta-command flags to send to the command, if any
See Also:
dequeCommand(), clearCommandQueue(), doCommand(List, int)

dequeCommand

boolean dequeCommand()
If this processor has enough action points to perform the top command on the que, then this method will execute that action. It returns whether there are still more actions on the que.

Returns:
true if there are more actions on the que, false otherwise
See Also:
enqueCommand(List, int, double), clearCommandQueue(), doCommand(List, int), commandQueSize(), actions()

clearCommandQueue

void clearCommandQueue()
Cancels and empties the command que of this processor.

See Also:
dequeCommand(), enqueCommand(List, int, double), doCommand(List, int), commandQueSize(), actions()

commandQueSize

int commandQueSize()
Returns the number of commands on this processors que

Returns:
the number of commands on this processors que
See Also:
dequeCommand(), clearCommandQueue(), doCommand(List, int), enqueCommand(List, int, double), actions()

doCommand

void doCommand(java.util.List<java.lang.String> commands,
               int metaFlags)
Forces this processor to parse the given command string tokens, determine a command to execute, and then execute it, regardless of whether there are any action points remaining.

Parameters:
commands - the command string tokens
metaFlags - any meta-command flags
See Also:
dequeCommand(), clearCommandQueue(), commandQueSize(), enqueCommand(List, int, double), actions()

actions

double actions()
Returns the number of action points that this processor has to spend towards performing any commands, skills, or whatever needs action points to be spent on them. They are usually replenished once per tick.

Returns:
the number of action points
See Also:
enqueCommand(List, int, double), setActions(double)

setActions

void setActions(double remain)
Sets the number of action points that this processor has to spend towards performing any commands, skills, or whatever needs action points to be spent on them. They are usually replenished once per tick.

Parameters:
remain - the number of action points
See Also:
enqueCommand(List, int, double), actions()