com.mineblown.challengescript.scripting
Class ScriptScheduler

java.lang.Object
  extended by com.mineblown.challengescript.scripting.ScriptScheduler

public class ScriptScheduler
extends java.lang.Object


Constructor Summary
ScriptScheduler()
           
 
Method Summary
 void cancelAllTasks()
          Cancels all remaining tasks
 void cancelTask(int inID)
          Cancels the task with the given id
 int scheduleDelayedTast(java.lang.String inMethod, java.lang.Object inObject)
          Schedules a task that executes given method on the next server tick
 int scheduleDelayedTast(java.lang.String inMethod, java.lang.Object inObject, int inDelay)
          Schedules a task that executes given method after a certain amount of ticks
 int scheduleRepeatingTask(java.lang.String inMethod, java.lang.Object inObject, int inStartDelay, int inRunDelay)
          Schedules a repeating task that executes given method every certain amount of time
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptScheduler

public ScriptScheduler()
Method Detail

scheduleDelayedTast

public int scheduleDelayedTast(java.lang.String inMethod,
                               java.lang.Object inObject)
Schedules a task that executes given method on the next server tick

Parameters:
inMethod - Name of the method that should be executed
inObject - Object that contains that method
Returns:
int representing the id of the task

scheduleDelayedTast

public int scheduleDelayedTast(java.lang.String inMethod,
                               java.lang.Object inObject,
                               int inDelay)
Schedules a task that executes given method after a certain amount of ticks

Parameters:
inMethod - Name of the method that should get executed
inObject - Object that contains that method
inDelay - Time in ticks before the task should start
Returns:
int representing the id of the task

scheduleRepeatingTask

public int scheduleRepeatingTask(java.lang.String inMethod,
                                 java.lang.Object inObject,
                                 int inStartDelay,
                                 int inRunDelay)
Schedules a repeating task that executes given method every certain amount of time

Parameters:
inMethod - Name of the method that should get executed
inObject - Object that contains that method
inStartDelay - Time in ticks before the first execution
inRunDelay - Time in ticks between executions
Returns:
int representing the id of the task

cancelTask

public void cancelTask(int inID)
Cancels the task with the given id

Parameters:
inID - Task ID

cancelAllTasks

public void cancelAllTasks()
Cancels all remaining tasks