|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrlgamekit.scheduler.Scheduler
public class Scheduler
Scheduler class for scheduled action objects. Helps to execute actions in a given order. Can be used for both, turn based and realtime games.
ScheduledAction| Constructor Summary | |
|---|---|
Scheduler()
Create a new scheduler with an empty queue of actions. |
|
| Method Summary | |
|---|---|
void |
clear()
Clears the action queue from all actions. |
void |
execute(long upToOrder)
Execute all scheduled actions up to a given order. |
ScheduledAction |
getNext()
If the execute loop of the scheduler class is not suitable for a project, this method allows to retrieve the next action, that is, the action with the lowest order number in the queue. |
void |
insert(ScheduledAction action)
Insert a new action into the scheduler. |
long |
peekNextOrder()
Get the order of the next scheduled action. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Scheduler()
| Method Detail |
|---|
public void clear()
public ScheduledAction getNext()
public void insert(ScheduledAction action)
action - An action with order value set.public long peekNextOrder()
public void execute(long upToOrder)
upToOrder - Process all actions with an order smaller than this.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||