Class BackCommand
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.BackCommand
-
Constructor Summary
ConstructorsConstructorDescriptionBackCommand(com.google.gson.JsonObject json) Overload command constructorBackCommand(String robotName, int steps) -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gson.JsonObjectModern OO implementation of the execute methodexecuteToString(World world) Each command must implement this method It does the work and returns a resultReturn which client command this command implementsgetUsage()Get the way this command is supposed to be used.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
-
BackCommand
-
BackCommand
public BackCommand(com.google.gson.JsonObject json) throws ClassCastException, UnsupportedOperationException, IllegalStateException Overload command constructor- Parameters:
json- the Json version of the input- Throws:
ClassCastExceptionUnsupportedOperationExceptionIllegalStateException
-
-
Method Details
-
executeToString
Description copied from class:CommandEach command must implement this method It does the work and returns a result- Specified by:
executeToStringin classCommand
-
execute
Modern OO implementation of the execute method -
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.This is used to return more robust errors to the client
- Specified by:
getUsagein classExternalCommand- Returns:
- the string representation of the usage of this command.
-