Interface Task

All Known Subinterfaces:
PriorityTask
All Known Implementing Classes:
ChaseTask, DefaultTask, MovementTask, ObstacleAttackTask, WaitTask, WanderTask

public interface Task
An AI task can be started and stopped at any time. When updating, the task can succeed or fail.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Interface Description
    static class  Task.Status  
  • Method Summary

    Modifier and Type Method Description
    void create​(TaskRunner taskRunner)
    Create the task and attach it to the task runner.
    Task.Status getStatus()
    Get the current status of the task.
    void start()
    Start running this task.
    void stop()
    Stop the task immediately.
    void update()
    Run one frame of the task.
  • Method Details

    • create

      void create​(TaskRunner taskRunner)
      Create the task and attach it to the task runner.
      Parameters:
      taskRunner - Task runner to attach to
    • start

      void start()
      Start running this task. This will usually be called by an AI controller.
    • update

      void update()
      Run one frame of the task. Similar to the update() in Components.
    • stop

      void stop()
      Stop the task immediately. This can be called at any time by the AI controller.
    • getStatus

      Task.Status getStatus()
      Get the current status of the task.
      Returns:
      status