Interface ScriptTask


  • public interface ScriptTask
    The interface Script task.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  ScriptTask.Builder  
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      int execute()
      Execute the Task - Implement logic to process an action within the game.
      default boolean isBlocking()
      Is blocking Task - If validate() returns true, receding Task will not be validated and the loop will restart.
      boolean validate()
      Validate the Task - Implement logic to validate conditions.
    • Method Detail

      • validate

        boolean validate()
        Validate the Task - Implement logic to validate conditions. If validate() returns true - execute() will be processed.
        Returns:
        result as boolean
      • execute

        int execute()
        Execute the Task - Implement logic to process an action within the game. If multiple Task are validated, and not blocking, the delay will be defined by the last Task to validate.
        Returns:
        the length of delay before validating setTasks() in TaskScript.
        See Also:
        "Return a positive integer to delay in ms, and a negative integer to delay in game ticks."
      • isBlocking

        default boolean isBlocking()
        Is blocking Task - If validate() returns true, receding Task will not be validated and the loop will restart.
        Returns:
        result as boolean