Class StateClientCommand

java.lang.Object
za.co.wethinkcode.robots.server.clientCommands.StateClientCommand
All Implemented Interfaces:
ClientCommand, Command

public class StateClientCommand extends Object implements ClientCommand
  • Constructor Details

    • StateClientCommand

      public StateClientCommand(StateCommandRequest request)
    • StateClientCommand

      public StateClientCommand(StateCommandRequest req, WorldState worldState, com.fasterxml.jackson.databind.ObjectMapper objectMapper) throws NoSuchRobotException
      Standard constructor for the state command from a client before evaluation
      Parameters:
      req - the request for it to be executed
      worldState - the current worldState it is being executed on
      objectMapper - the standard object mapper
      Throws:
      NoSuchRobotException
  • Method Details

    • execute

      public CommandResult execute(Map<String,Argument> args, WorldState worldState)
      Specified by:
      execute in interface Command
      Parameters:
      args - arguments for this Command
      worldState - the current state of the world
      Returns:
      an immutable evaluation of the command
    • execute

      public CommandResult execute(ServerRobot target, Map<String,Argument> args, WorldState worldState)
      Description copied from interface: ClientCommand
      Overload of execute method that supports passing in a robot as the target for a command
      Specified by:
      execute in interface ClientCommand
      Parameters:
      target - the target that this command will be executed on
      args - arguments for this Command
      worldState - the current state of the world
      Returns:
      an immutable evaluation of the command