Class ScheduleExtensions
Convenience extension methods that turn common scheduling intents into one-liners on
ScyllaClock. Built on top of the underlying Scylla.Core.Time.TickScheduler
and predicate-watcher list - provides the ergonomics most game code wants without
callers having to compute fire-tick milliseconds themselves.
Inheritance
ScheduleExtensions
Assembly: ScyllaCore.dll
Syntax
public static class ScheduleExtensions
Methods
Cancel(ScyllaClock, ScheduledTickHandle)
Cancels a previously-scheduled callback. Works for handles returned by any of the
extension methods on this class - the dispatch correctly identifies whether the
handle belongs to the absolute-time scheduler or the predicate watcher list.
Declaration
public static bool Cancel(this ScyllaClock clock, ScheduledTickHandle handle)
Parameters
Returns
| Type |
Description |
| bool |
true if a matching scheduled entry was found and cancelled.
|
RunAfter(ScyllaClock, TimeUnit, Action)
Declaration
public static ScheduledTickHandle RunAfter(this ScyllaClock clock, TimeUnit delay, Action callback)
Parameters
Returns
RunAfter(ScyllaClock, float, Action)
Schedule callback to fire once after
scaledSeconds of CLOCK time has elapsed (i.e., after the clock
advances scaledSeconds in its own scaled-time domain).
Pause and rate changes on the clock automatically delay the firing.
Declaration
public static ScheduledTickHandle RunAfter(this ScyllaClock clock, float scaledSeconds, Action callback)
Parameters
Returns
Exceptions
RunAtDate(ScyllaClock, GameDate, Action)
Schedule callback to fire when the clock first crosses
date. The supplied date's CalendarHash
must match the clock's calendar (or be the default zero hash).
Declaration
public static ScheduledTickHandle RunAtDate(this ScyllaClock clock, GameDate date, Action callback)
Parameters
Returns
RunEvery(ScyllaClock, TimeUnit, Action)
Declaration
public static ScheduledTickHandle RunEvery(this ScyllaClock clock, TimeUnit interval, Action callback)
Parameters
Returns
RunEvery(ScyllaClock, float, Action)
Schedule callback to fire every scaledSeconds
of clock time, beginning scaledSeconds from the current tick.
The first invocation is at now + scaledSeconds; subsequent invocations
repeat at the same interval.
Declaration
public static ScheduledTickHandle RunEvery(this ScyllaClock clock, float scaledSeconds, Action callback)
Parameters
Returns
WaitUntil(ScyllaClock, Func<bool>, Action)
Polls predicate once per clock tick and fires
callback the first time it returns true. The watcher
self-cancels after firing.
Declaration
public static ScheduledTickHandle WaitUntil(this ScyllaClock clock, Func<bool> predicate, Action callback)
Parameters
Returns