Class ShowCommand

Object
NormalCommand
ShowCommand
All Implemented Interfaces:
Command, ItemCommand

public class ShowCommand extends NormalCommand implements ItemCommand
Showing an item to a bot. Syntax : show <item> to <character>. The one reason why this is useful is when you wish to know the value of a certain item.
See Also:
  • Constructor Details

    • ShowCommand

      public ShowCommand(String aRegExpr)
  • Method Details

    • run

      public DisplayInterface run(String command, User aUser) throws MudException
      Provides the item to a shopkeeper for appraisal. There are a couple of requirements that need to be met, before a successful appraisal takes place.
      1. command struct. should be "show <item> to <character>", for example: "show gold ring to Karcas".
      2. shopkeeper buying the item should
        1. exist,
        2. be in the same room and
        3. have a god==4 to indicate "shopkeeper"
      3. the customer should have the item
      The following sequence of events:
      1. the shopkeeper mentions how much he/she would give for the item.
      2. continue with next item
      Specified by:
      run in interface Command
      Specified by:
      run in class NormalCommand
      Parameters:
      command - the String containing the full command.
      aUser - the character doing the showing.
      Returns:
      DisplayInterface to display to the user, if it returns null, it means the command was unsuccessfull.
      Throws:
      ItemException - in case the appropriate items could not be properly processed.
      ParseException - if the item description or the number of items requested is illegal.
      MudException - if something goes wrong.