diff --git a/game/src/main/org/apollo/game/scheduling/ScheduledTask.java b/game/src/main/org/apollo/game/scheduling/ScheduledTask.java index 8f80129d..3b360673 100644 --- a/game/src/main/org/apollo/game/scheduling/ScheduledTask.java +++ b/game/src/main/org/apollo/game/scheduling/ScheduledTask.java @@ -28,8 +28,7 @@ public abstract class ScheduledTask { * Creates a new scheduled task. * * @param delay The delay between executions of the task, in pulses. - * @param immediate A flag indicating if this task should (for the first execution) be ran immediately, or after the - * {@code delay}. + * @param immediate Indicates whether or not this task should be executed immediately, or after the {@code delay}. * @throws IllegalArgumentException If the delay is less than or equal to zero. */ public ScheduledTask(int delay, boolean immediate) { @@ -37,11 +36,6 @@ public abstract class ScheduledTask { pulses = immediate ? 0 : delay; } - /** - * Executes this task. - */ - public abstract void execute(); - /** * Checks if this task is running. * @@ -51,16 +45,6 @@ public abstract class ScheduledTask { return running; } - /** - * Pulses this task: updates the delay and calls {@link #execute()} if necessary. - */ - final void pulse() { - if (running && pulses-- == 0) { - execute(); - pulses = delay; - } - } - /** * Sets the delay. * @@ -79,4 +63,19 @@ public abstract class ScheduledTask { running = false; } + /** + * Executes this task. + */ + public abstract void execute(); + + /** + * Pulses this task: updates the delay and calls {@link #execute()} if necessary. + */ + final void pulse() { + if (running && --pulses <= 0) { + execute(); + pulses = delay; + } + } + } \ No newline at end of file