Package za.co.wethinkcode.robots.domain
Enum Class ImplementedClientCommands
- All Implemented Interfaces:
Serializable,Comparable<ImplementedClientCommands>,Constable
The Implemented client Commands enum captures the allowed variants of a Client Command
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBack command moves aRobotbackwardsfire command fires a bullet from aRobotwith a gunforward command moves aRobotforwardsThe help command displays all currently available command and their usages.launch command launches a newRobotLook command displays information about theRobot's surroundingsmine command drops a mine from aRobotwho uses minesDisconnects the currently connected client from the serverThe state command returns information about the currentRobot's stateThe swap command is an internally implemented client command that allows the client to switch between different launchedRobotThe turn command moves the current robot's ordinal in theDirectionenum.Displays configuration information about theWorldConfig -
Method Summary
Modifier and TypeMethodDescriptionThe available aliases of an implemented Client CommandHow this command is intended to be called e.g.static Optional<ImplementedClientCommands> Returns either an Implemented ClientCommand or null, but leads it to the call site to handle the null casestatic ImplementedClientCommandsReturns the enum constant of this class with the specified name.static ImplementedClientCommands[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
back
Back command moves aRobotbackwards -
fire
fire command fires a bullet from aRobotwith a gun -
forward
forward command moves aRobotforwards -
help
The help command displays all currently available command and their usages. -
launch
launch command launches a newRobot -
look
Look command displays information about theRobot's surroundings -
mine
mine command drops a mine from aRobotwho uses mines -
orientation
-
repair
-
reload
-
state
The state command returns information about the currentRobot's state -
swap
The swap command is an internally implemented client command that allows the client to switch between different launchedRobot -
turn
The turn command moves the current robot's ordinal in theDirectionenum. -
world
Displays configuration information about theWorldConfig -
quit
Disconnects the currently connected client from the server
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getAliases
The available aliases of an implemented Client Command- Returns:
- all the available aliases for client commands
-
resolveFromAlias
Returns either an Implemented ClientCommand or null, but leads it to the call site to handle the null case- Parameters:
s- the potential command being parsed- Returns:
- either the ImplementedClientCommand it's an alias for or null
-
getHelpInfo
How this command is intended to be called e.g. launch invalid input: '<'\make> invalid input: '<'\name>- Returns:
- the intended usage of this command
-
getResponseKind
- Returns:
- the
ResponseKindof the currently executing command
-