wyvern.lib.commands
Class StartupCommand

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.commands.SimpleHandler
          extended bywyvern.lib.commands.StartupCommand
All Implemented Interfaces:
BuiltInCommand, Command, PropertyList

public class StartupCommand
extends SimpleHandler

Allows you to specify commands that run when you log in.

Version:
1.0, Aug 21, 2003
Author:
Zerth, contributed to Cabochon, stevey - tweaked a little

Field Summary
static int MAX_PLAYER_COMMANDS
           
static int MAX_WIZ_COMMANDS
           
 
Fields inherited from class wyvern.kernel.commands.SimpleHandler
delay_
 
Fields inherited from class wyvern.kernel.properties.PList
readOnly_
 
Fields inherited from interface wyvern.lib.PropertyList
PROPERTY_PACKAGE
 
Method Summary
 void addCommands(java.util.Map commands, CommandList list)
          Adds our commands.
static StartupCommand getImpl()
           
 boolean handleAdd(Commandable agent, java.lang.String[] args)
          Adds a new command to the end of the list.
 boolean handleChange(Commandable agent, java.lang.String[] args)
          Changes the command stored at a particular location.
 boolean handleEvent(CommandEvent event)
          Modifies or views the startup-cmds list.
 boolean handleList(Commandable agent, java.lang.String[] args)
          Lists out your stored commands, with nice counting numbers in front of each one.
 boolean handleMove(Commandable agent, java.lang.String[] args)
          Moves a startup command to a new spot in the list.
 boolean handleRemove(Commandable agent, java.lang.String[] args)
          Removes a command from the list, by counting numbers.
 
Methods inherited from class wyvern.kernel.commands.SimpleHandler
createEvent, execute, knowsCommand
 
Methods inherited from class wyvern.kernel.properties.PList
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, debugProperties, dismantlePropertyList, getDoubleProperty, getInheritedProperty, getInteger, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProfilingInfo, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, toString, transientlyRemoveProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_PLAYER_COMMANDS

public static final int MAX_PLAYER_COMMANDS
See Also:
Constant Field Values

MAX_WIZ_COMMANDS

public static final int MAX_WIZ_COMMANDS
See Also:
Constant Field Values
Method Detail

getImpl

public static StartupCommand getImpl()

addCommands

public void addCommands(java.util.Map commands,
                        CommandList list)
Description copied from class: SimpleHandler
Adds our commands. Subclasses should override this and, for each command the subclass wants to implement, put it in the "commands" map.

Specified by:
addCommands in interface BuiltInCommand
Specified by:
addCommands in class SimpleHandler
Parameters:
commands - a Map whose keys are the command verbs, and whose values are references to the SimpleHandler instance that wants to handle the command.
list - the Player, Monster, Vehicle or other CommandList implementation for which addCommands() is being called.

handleEvent

public boolean handleEvent(CommandEvent event)
Modifies or views the startup-cmds list.

Specified by:
handleEvent in class SimpleHandler
Parameters:
event - a CommandEvent with various fields filled in: the agent performing the command, the command verb and arguments, the delay for the command, and success/failure messages.
Returns:
true if it was completed successfully

handleAdd

public boolean handleAdd(Commandable agent,
                         java.lang.String[] args)
Adds a new command to the end of the list. Possibly need a "startup insert" for those who are to lazy to do a "startup move" after this.

Parameters:
agent - the player
args - their args - first one is the subcommand, and there's guaranteed to be at least one more.
Returns:
true if we handled the subcommand successfully

handleRemove

public boolean handleRemove(Commandable agent,
                            java.lang.String[] args)
Removes a command from the list, by counting numbers. Also supports "first" and "last".

Parameters:
agent - the player
args - their args - first one is the subcommand, and there's guaranteed to be at least one more.
Returns:
true if we handled the subcommand successfully

handleMove

public boolean handleMove(Commandable agent,
                          java.lang.String[] args)
Moves a startup command to a new spot in the list.

Parameters:
agent - the player
args - their args - first one is the subcommand, and there's guaranteed to be at least one more.
Returns:
true if we handled the subcommand successfully

handleList

public boolean handleList(Commandable agent,
                          java.lang.String[] args)
Lists out your stored commands, with nice counting numbers in front of each one.

Parameters:
agent - the player
args - their args - first one is the subcommand, and there's guaranteed to be at least one more.
Returns:
true if we handled the subcommand successfully

handleChange

public boolean handleChange(Commandable agent,
                            java.lang.String[] args)
Changes the command stored at a particular location.

Parameters:
agent - the player
args - their args - first one is the subcommand, and there's guaranteed to be at least one more.
Returns:
true if we handled the subcommand successfully