Module ROT.Scheduler.Speed
The Speed based scheduler
Functions
add (item, repeating, time) | Add. |
next () | Next. |
getTime () | Get Time. |
clear () | Clear. |
remove (item) | Remove. |
Functions
- add (item, repeating, time)
-
Add.
Add an item to the schedule
Parameters:
- item userdata Any class/module/userdata with a :getSpeed() function. The value returned by getSpeed() should be a number.
- repeating boolean If true, this item will be rescheduled once it is returned by .next()
- time number Initial time offset, defaults to 1/item:getSpeed()
Returns:
-
ROT.Scheduler.Speed
self
- next ()
-
Next.
Get the next item from the scheduler and advance the appropriate amount time
Returns:
-
item or nil
The item previously added by .add() or nil if none are queued
- getTime ()
-
Get Time.
Get time counted since start
Returns:
-
int
elapsed time
- clear ()
-
Clear.
Remove all items from scheduler
Returns:
-
ROT.Scheduler.Speed
self
- remove (item)
-
Remove.
Find and remove an item from the scheduler
Parameters:
- item any The previously added item to be removed
Returns:
-
boolean
true if an item was removed from the scheduler