Class RepeatThreadTask

java.lang.Object
studio.magemonkey.fabled.thread.RepeatThreadTask
All Implemented Interfaces:
Runnable, IThreadTask
Direct Known Subclasses:
ArmorStandTask, CooldownTask, EffectTask, GUITask, ManaTask, ProjectileTickTask, SaveTask

public abstract class RepeatThreadTask extends Object implements IThreadTask
A thread task that continually runs in the background
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    RepeatThreadTask(int delay, int interval)
    Sets up the task with an initial delay and an interval
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Ticks the task, running periodically depending on the interval

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface studio.magemonkey.fabled.thread.IThreadTask

    run
  • Field Details

    • expired

      protected boolean expired
  • Constructor Details

    • RepeatThreadTask

      public RepeatThreadTask(int delay, int interval)
      Sets up the task with an initial delay and an interval
      Parameters:
      delay - delay before first run
      interval - delay between subsequent runs
  • Method Details

    • tick

      public boolean tick()
      Ticks the task, running periodically depending on the interval
      Specified by:
      tick in interface IThreadTask
      Returns:
      true if expired