Package studio.magemonkey.fabled.thread
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
A thread task that continually runs in the background
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRepeatThreadTask
(int delay, int interval) Sets up the task with an initial delay and an interval -
Method Summary
Modifier and TypeMethodDescriptionboolean
tick()
Ticks the task, running periodically depending on the intervalMethods 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 runinterval
- delay between subsequent runs
-
-
Method Details
-
tick
public boolean tick()Ticks the task, running periodically depending on the interval- Specified by:
tick
in interfaceIThreadTask
- Returns:
- true if expired
-