java.lang.Object
com.adventure.commands.AbstractCommand
com.adventure.commands.CmdFight
- All Implemented Interfaces:
Command
Command used to start a fight with an enemy (if there is one).
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class com.adventure.commands.AbstractCommand
args, BUSY_WAITING_QUANTUM, context, inputStream, logger, shouldTerminate, writer
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.adventure.commands.AbstractCommand
askConfirmation, correctArgumentsNumber, disableDummyCommands, disableSaveAll, enableDummyCommands, getArgs, getContext, getInputStream, getWriter, reEnableSaved, safeReadNext, safeReadNextLine, setArgs, setContext, setInputStream, setWriter
-
Constructor Details
-
CmdFight
public CmdFight()
-
-
Method Details
-
execute
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 interfaceCommand
- Overrides:
kill
in classAbstractCommand
-
getPossibleArgs
Description copied from class:AbstractCommand
Gets possible args for current command.- Specified by:
getPossibleArgs
in interfaceCommand
- Specified by:
getPossibleArgs
in classAbstractCommand
- Returns:
- A list of possible arguments for the command.
-