Class BaseInstructionHandler

java.lang.Object
uni.robot.game.robotinstruction.RobotInstructionHandler
uni.robot.game.robotinstruction.BaseInstructionHandler

public class BaseInstructionHandler extends RobotInstructionHandler
El RobotInstructionHandler que maneja todas las instrucciones bases (Avanzar, girar, etc.).
  • Constructor Details

    • BaseInstructionHandler

      public BaseInstructionHandler()
  • Method Details

    • handleActionInstruction

      public RobotState handleActionInstruction(RobotObject robot, String instruction)
      Description copied from class: RobotInstructionHandler
      Metodo abstracto especializado en manejar instrucciones acciones.
      Specified by:
      handleActionInstruction in class RobotInstructionHandler
      Parameters:
      robot - El robot que recibio la instruccion
      instruction - Un String que se utiliza para determinar el tipo de instruccion que recibio
      Returns:
      Un RobotState que representa el estado nuevo que transicionara el robot acorde a la instruccion recibida. O null si este handler no puede manejar la instruccion recibida.
      See Also:
    • handleSensorInstruction

      public Object handleSensorInstruction(RobotObject robot, String instruction)
      Description copied from class: RobotInstructionHandler
      Metodo abstracto especializado en manejar instrucciones sensores.
      Specified by:
      handleSensorInstruction in class RobotInstructionHandler
      Parameters:
      robot - El robot que recibio la instruccion
      instruction - Un String que se utiliza para determinar el tipo de instruccion que recibio
      Returns:
      Cualquier valor no-nulo que representa el valor retornado por el sensor, segun la instruccion recibida. O null si este handler no puede manejar la instruccion recibida.