Class DropCommand

Object
NormalCommand
DropCommand
All Implemented Interfaces:
Command

public class DropCommand extends NormalCommand
Drop an item onto the floor: "drop bucket". This command will make a best effort regarding dropping of the requested items. This means that, if you request 5 items, and there are 5 or more items in your inventory, this method will attempt to aquire 5 items. It is possible that not all items are available, in which case you could conceivably only receive 3 items for instance.
Author:
maartenl
See Also:
  • Constructor Details

    • DropCommand

      public DropCommand(String aRegExpr)
  • Method Details

    • run

      public DisplayInterface run(String command, User aUser) throws MudException
      Description copied from interface: Command
      Runs the command. The usual sequence of events is:
      • parsing the command string
      • retrieving the appropriate information items/rooms/characters/etc)
      • doing the action
      • composing a return message for the user.
      Specified by:
      run in interface Command
      Specified by:
      run in class NormalCommand
      Parameters:
      command - the String containing the full command.
      aUser - the user that is executing the command
      Returns:
      DisplayInterface to display to the user, if it returns null, it means the command was unsuccessfull.
      Throws:
      MudException - if something goes wrong.