Class WaitTask

java.lang.Object
com.deco2800.game.ai.tasks.DefaultTask
com.deco2800.game.components.tasks.WaitTask
All Implemented Interfaces:
Task

public class WaitTask
extends DefaultTask
Task that does nothing other than waiting for a given time. Status is Finished after the time has passed.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.deco2800.game.ai.tasks.Task

    Task.Status
  • Field Summary

    Fields inherited from class com.deco2800.game.ai.tasks.DefaultTask

    owner, status
  • Constructor Summary

    Constructors 
    Constructor Description
    WaitTask​(float duration)  
  • Method Summary

    Modifier and Type Method Description
    void start()
    Start waiting from now until duration has passed.
    void update()
    Run one frame of the task.

    Methods inherited from class com.deco2800.game.ai.tasks.DefaultTask

    create, getStatus, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WaitTask

      public WaitTask​(float duration)
      Parameters:
      duration - How long to wait for, in seconds.
  • Method Details

    • start

      public void start()
      Start waiting from now until duration has passed.
      Specified by:
      start in interface Task
      Overrides:
      start in class DefaultTask
    • update

      public void update()
      Description copied from interface: Task
      Run one frame of the task. Similar to the update() in Components.
      Specified by:
      update in interface Task
      Overrides:
      update in class DefaultTask