Interface IUtility
- Namespace
- SkyrimForge
- Assembly
- SkyrimForge.dll
Waits and cooldowns measured by UnpausedTime.
public interface IUtility
- Extension Methods
Methods
CreateCooldown(TimeSpan)
Creates an ICooldown for duration of UnpausedTime from each start.
ICooldown CreateCooldown(TimeSpan duration)
Parameters
durationTimeSpan
Returns
Exceptions
- ArgumentOutOfRangeException
durationis zero or less.
Wait(TimeSpan, CancellationToken)
Waits for duration of UnpausedTime, which does not advance while a menu pauses the game.
Task Wait(TimeSpan duration, CancellationToken cancellationToken = default)
Parameters
durationTimeSpanThe duration. Zero or less completes on the next frame.
cancellationTokenCancellationTokenCancels the wait on the next frame.
Returns
- Task
A task that completes on the first frame at least
durationlater.
Remarks
The task completes inside OnFrame, so the continuation may call the game. A frame counts for at most 0.25 seconds. A new game or a save load cancels the wait on the next frame, so the continuation never runs in a game other than the one that started the wait. Do not block on the task on the game's thread.