wyvern.lib.commands
Class DropCommand

java.lang.Object
  extended bywyvern.lib.commands.DropCommand
All Implemented Interfaces:
BuiltInCommand, Command

public class DropCommand
extends java.lang.Object
implements BuiltInCommand

Drops an item from the agent's inventory.

Version:
1.0, Sep 02, 1997
Author:
Steve Yegge

Method Summary
 void addCommands(java.util.Map commands, CommandList list)
          Adds commands.
 CommandEvent createEvent(CommandEvent initial)
          Creates a drop event.
 boolean execute(CommandEvent ev)
          Executes the DropEvent.
static DropCommand getImpl()
           
 boolean knowsCommand(java.lang.String command)
          We don't have any way of determining that we don't know how to handle the command based just on its arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getImpl

public static DropCommand getImpl()

addCommands

public void addCommands(java.util.Map commands,
                        CommandList list)
Adds commands.

Specified by:
addCommands in interface BuiltInCommand
Parameters:
list - the CommandList we're being added to
commands - the Map to which to add the commands we handle

knowsCommand

public boolean knowsCommand(java.lang.String command)
We don't have any way of determining that we don't know how to handle the command based just on its arguments.

Specified by:
knowsCommand in interface Command
Parameters:
command - the command to examine
Returns:
true

createEvent

public CommandEvent createEvent(CommandEvent initial)
Creates a drop event.

Specified by:
createEvent in interface Command
Parameters:
initial - the "starter" event, with the args & agent
Returns:
a TargetedEvent containing the event target, quantity, messages, and so on.

execute

public boolean execute(CommandEvent ev)
Executes the DropEvent.

Specified by:
execute in interface Command
Parameters:
ev - the TargetedEvent to execute
Returns:
true if it executed successfully