Class TellCommand

All Implemented Interfaces:
Command

public class TellCommand extends TargetCommand
Tell to someone something. The difference with normal communication commands, is that this one is mandatory to a person and the person does not need to be in the same room: "tell to Karn Help!".
Author:
maartenl
  • Constructor Details

    • TellCommand

      public TellCommand(String aRegExpr)
  • Method Details

    • getCommType

      public CommType getCommType()
    • actionTo

      protected DisplayInterface actionTo(User aUser, Person aTarget, String verb, String message) throws MudException
      Description copied from class: TargetCommand
      Run the action command to a target.
      Specified by:
      actionTo in class TargetCommand
      Parameters:
      aUser - the one executing the command
      aTarget - the target of the command
      verb - the verb, usually the first word in the command, for example "cheer".
      message - the rest of the command, for example "bow to Marvin evilly", will provide "evilly". But "bow to Marvin" will return a null pointer.
      Returns:
      something to display
      Throws:
      MudException
    • action

      protected DisplayInterface action(User aUser, String verb, String command) throws MudException
      Does not compute, TellCommand requires a target name.
      Specified by:
      action in class TargetCommand
      Parameters:
      aUser -
      verb -
      command -
      Returns:
      DisplayInterface of the action.
      Throws:
      MudException
    • getTarget

      protected Person getTarget(String[] myParsed, User aUser) throws PersonNotFoundException
      Description copied from class: TargetCommand
      Retrieves a target from the command line, detected in the form of "[command] to [target] stuff".
      Overrides:
      getTarget in class TargetCommand
      Parameters:
      myParsed - the command, parsed. Usually only needs the first three words.
      aUser - the user issuing the command
      Returns:
      the Person found.
      Throws:
      PersonNotFoundException - if the person is not found in the room.