Class CmdFight

All Implemented Interfaces:
Command

public class CmdFight extends AbstractCommand
Command used to start a fight with an enemy (if there is one).
  • Constructor Details

    • CmdFight

      public CmdFight()
  • Method Details

    • execute

      public void execute() throws InterruptedException
      Description copied from interface: Command
      Executes the command.
      Throws:
      InterruptedException - Thrown if the command is interrupted (e.g. when kill is well implemented).
    • kill

      public void kill()
      Description copied from interface: Command
      Requests command termination. This ONLY asks the command to terminate, but termination depends on the correct implementation of the command. If the command was executing then it will throw InterruptedException.
      Specified by:
      kill in interface Command
      Overrides:
      kill in class AbstractCommand
    • getPossibleArgs

      public List<String> getPossibleArgs()
      Description copied from class: AbstractCommand
      Gets possible args for current command.
      Specified by:
      getPossibleArgs in interface Command
      Specified by:
      getPossibleArgs in class AbstractCommand
      Returns:
      A list of possible arguments for the command.