Class LookCommand
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.LookCommand
The Look command class.
Basics of Command
-
Constructor Summary
ConstructorsConstructorDescriptionLookCommand(com.google.gson.JsonObject json) Construct a look command from incoming jsonLookCommand(String robotName) Standard constructor for the look command. -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.gson.JsonObjectaddLookObjectDetails(String direction, String description) Deprecated.com.google.gson.JsonObjectModern a modern 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.static intlookObjectDistance(String description) Deprecated.static StringlookObjectType(String description) Deprecated.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
-
LookCommand
Standard constructor for the look command. Accepts a robot name- Parameters:
robotName- the name of the robot that is launching this command
-
LookCommand
public LookCommand(com.google.gson.JsonObject json) Construct a look command from incoming json- Parameters:
json- the incoming json.
-
-
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
-
addLookObjectDetails
@Deprecated public static com.google.gson.JsonObject addLookObjectDetails(String direction, String description) Deprecated. -
lookObjectType
Deprecated. -
lookObjectDistance
Deprecated. -
execute
Modern a 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.- Specified by:
getUsagein classExternalCommand- Returns:
- the string representation of the usage of this command.
-