Class MineCommand
java.lang.Object
za.co.wethinkcode.robots.server.commands.Command
za.co.wethinkcode.robots.server.commands.external.ExternalCommand
za.co.wethinkcode.robots.server.commands.external.MineCommand
- All Implemented Interfaces:
Stateful
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gson.JsonObjectModern a modern OO implementation of the execute methodexecuteToString(World world) Deprecated.Return which client command this command implementsgetUsage()Get the way this command is supposed to be used.Verify if a command is able to be executed given the current state of the robot.Methods inherited from class za.co.wethinkcode.robots.server.commands.external.ExternalCommand
getArgsMethods inherited from class za.co.wethinkcode.robots.server.commands.Command
findRobot, getRobotName
-
Constructor Details
-
MineCommand
public MineCommand(com.google.gson.JsonObject json) throws ClassCastException, UnsupportedOperationException, IllegalStateException Overload command constructor- Parameters:
json- the Json version of the input- Throws:
ClassCastExceptionUnsupportedOperationExceptionIllegalStateException
-
-
Method Details
-
getCommandName
Return which client command this command implements- Specified by:
getCommandNamein classExternalCommand- Returns:
- the command this child is
-
getUsage
Get the way this command is supposed to be used.Example for a command foo#robot-world-client > invalid input: '<'foo-usage> invalid input: '<'foo-args>- Specified by:
getUsagein classExternalCommand- Returns:
- the string representation of the usage of this command.
-
executeToString
Deprecated.Each command must implement this method It does the work and returns a result- Specified by:
executeToStringin classCommand- Parameters:
world-
-
execute
Modern a modern OO implementation of the execute method -
verify
Verify if a command is able to be executed given the current state of the robot. THIS METHOD INDUCES THE SIDE EFFECT OF CHANGING THEStatusOF THE ROBOT, updating it'sStatusif needed.- Specified by:
verifyin interfaceStateful- Parameters:
world- the world that this command is being verified against.- Returns:
- the status of the robot executing the command.
- Throws:
RobotCannotActException
-