Table of Contents

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

duration TimeSpan

Returns

ICooldown

Exceptions

ArgumentOutOfRangeException

duration is 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

duration TimeSpan

The duration. Zero or less completes on the next frame.

cancellationToken CancellationToken

Cancels the wait on the next frame.

Returns

Task

A task that completes on the first frame at least duration later.

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.