Class UnlockCommand

Object
NormalCommand
UnlockCommand
All Implemented Interfaces:
Command

public class UnlockCommand extends NormalCommand
Unlocks a container with a key: "unlock chest with key". Requirements for it to be successfull:
  • the container must be in your inventory or in the room
  • the container must be a container
  • the container must be closed
  • the container must be lockable.
  • the container must be locked.
  • the key item must be in your inventory
The possible syntax can range from: "unlock chest with key" to "unlock iron studded wooden chest with old long ornate key".
See Also:
  • Constructor Details

    • UnlockCommand

      public UnlockCommand(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.