RedHerring.Alibi
1.0.0
dotnet add package RedHerring.Alibi --version 1.0.0
NuGet\Install-Package RedHerring.Alibi -Version 1.0.0
<PackageReference Include="RedHerring.Alibi" Version="1.0.0" />
paket add RedHerring.Alibi --version 1.0.0
#r "nuget: RedHerring.Alibi, 1.0.0"
// Install RedHerring.Alibi as a Cake Addin #addin nuget:?package=RedHerring.Alibi&version=1.0.0 // Install RedHerring.Alibi as a Cake Tool #tool nuget:?package=RedHerring.Alibi&version=1.0.0
Red Herring Alibi
Simple update scheduler and ticker for your game. Use this if you want to have better control when your updates get called and free up some performance.
Scheduled Updates
The basic idea is that whatever callback you schedule, the only guarantee is that the callback will not be called before its due time.
There is, however, no guarantee that it will be called precisely when scheduled.
All time-related parameters are either a TimeSpan
or a long
in milliseconds.
Constructor
Scheduler(TimeSpan startingTime, long frameBudget);
startingTime
- starting time for ticks
frameBudget
- the maximum amount of time per one invoke of the Tick
method
Tick
void Tick(TimeSpan time);
time
- game time according to which scheduled updates should be invoked.
Starts calling scheduled updates until it exceeds the frameBudget
specified within constructor.
Dispose
void Dispose();
Basic cleanup when getting rid of the scheduler.
SetFrameBudget
void SetFrameBudget(long frameBudget);
Sets the new frame budget. Useful when changing target framerate of the application during runtime.
Schedule
public delegate void DeferredUpdate(double elapsedTime);
IDisposable Schedule(DeferredUpdate update, long dueTime);
IDisposable ScheduleRepeating(DeferredUpdate update, long period);
The specified callback will be called after dueTime
has elapsed, but not before.
Optionally, a recurring callback can be specified with a period
.
The callback can be unscheduled by disposing of the IDisposable
object.
Notice: Callback will never be called within the same tick as it was scheduled.
Unschedule
void Unschedule(DeferredUpdate update);
The specified callback will be unregistered from scheduled updates.
Clear
All scheduled updated will be unscheduled.
Ticker
Calls registered updates each tick, regardless of time.
Add
public delegate void TickUpdate();
IDisposable Add(TickUpdate update);
IDisposable Add(TickUpdate update, int priority);
priority
- priority with which the update is to be called (higher means sooner).
Adds the specified callback to the list of updates to be called during a tick.
Remove
bool Remove(TickUpdate update)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- System.Reactive (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 129 | 9/16/2023 |