public class RepairCommand extends ExternalCommand
The Repair Command restores a robot's shield to their configured maximum.

World configures how long a repair takes (in seconds) via getRepairTime

Shields are repaired to full amount (maxShields) after repair time

It is always the same amount of time regardless of how many hits remain

Shields cannot exceed configured maximum.

Robot cannot move while repairing

  • Constructor Details

    • RepairCommand

      public RepairCommand(String robotName)
    • RepairCommand

      public RepairCommand(com.google.gson.JsonObject json)
      Construct a repair command from incoming Parsed JSON
      Parameters:
      json - the incoming JSON
  • Method Details

    • executeToString

      public String executeToString(World world)
      Description copied from class: Command
      Each command must implement this method It does the work and returns a result
      Specified by:
      executeToString in class Command
    • execute

      public com.google.gson.JsonObject execute(World world)
      Modern a modern OO implementation of the execute method
      Specified by:
      execute in class Command
      Parameters:
      world -
    • getCommandName

      public ImplementedClientCommands getCommandName()
      Return which client command this command implements
      Specified by:
      getCommandName in class ExternalCommand
      Returns:
      the command this child is
    • getUsage

      public String getUsage()
      Get the way this command is supposed to be used.
      Specified by:
      getUsage in class ExternalCommand
      Returns:
      the string representation of the usage of this command.
    • sleepForRepair

      protected void sleepForRepair(int seconds)