Table of Contents

Class UnityLoopTickerFactory

Namespace
Uncreated.Warfare.Util.Timing
Assembly
Uncreated.Warfare.dll
public class UnityLoopTickerFactory : ILoopTickerFactory
Inheritance
UnityLoopTickerFactory
Implements
Inherited Members

Constructors

UnityLoopTickerFactory(WarfareLifetimeComponent, ILogger<UnityLoopTickerFactory>)

public UnityLoopTickerFactory(WarfareLifetimeComponent component, ILogger<UnityLoopTickerFactory> logger)

Parameters

component WarfareLifetimeComponent
logger ILogger<UnityLoopTickerFactory>

Methods

CreateTicker(TimeSpan, bool, bool, TickerCallback<ILoopTicker>?)

Create a new ticker.

public ILoopTicker CreateTicker(TimeSpan periodicDelay, bool invokeImmediately, bool queueOnGameThread, TickerCallback<ILoopTicker>? onTick = null)

Parameters

periodicDelay TimeSpan

How often to invoke the ticker.

invokeImmediately bool

If the ticker should be invoked now or wait a period.

queueOnGameThread bool

Callback will always be fired on the game thread (if it exists).

onTick TickerCallback<ILoopTicker>

Callback since the event being invoked now would mean you couldn't subscribe to the event first.

Returns

ILoopTicker

CreateTicker(TimeSpan, TimeSpan, bool, TickerCallback<ILoopTicker>?)

Create a new ticker.

public ILoopTicker CreateTicker(TimeSpan initialDelay, TimeSpan periodicDelay, bool queueOnGameThread, TickerCallback<ILoopTicker>? onTick = null)

Parameters

initialDelay TimeSpan

How long to wait to initially invoke the ticker.

periodicDelay TimeSpan

How often to invoke the ticker.

queueOnGameThread bool

Callback will always be fired on the game thread (if it exists).

onTick TickerCallback<ILoopTicker>

Callback since the event being invoked now would mean you couldn't subscribe to the event first.

Returns

ILoopTicker

CreateTicker<TState>(TimeSpan, bool, TState?, bool, TickerCallback<ILoopTicker<TState>>?)

Create a new ticker.

public ILoopTicker<TState> CreateTicker<TState>(TimeSpan periodicDelay, bool invokeImmediately, TState? state, bool queueOnGameThread, TickerCallback<ILoopTicker<TState>>? onTick = null)

Parameters

periodicDelay TimeSpan

How often to invoke the ticker.

invokeImmediately bool

If the ticker should be invoked now or wait a period.

state TState
queueOnGameThread bool

Callback will always be fired on the game thread (if it exists).

onTick TickerCallback<ILoopTicker<TState>>

Callback since the event being invoked now would mean you couldn't subscribe to the event first.

Returns

ILoopTicker<TState>

Type Parameters

TState

CreateTicker<TState>(TimeSpan, TimeSpan, TState?, bool, TickerCallback<ILoopTicker<TState>>?)

Create a new ticker.

public ILoopTicker<TState> CreateTicker<TState>(TimeSpan initialDelay, TimeSpan periodicDelay, TState? state, bool queueOnGameThread, TickerCallback<ILoopTicker<TState>>? onTick = null)

Parameters

initialDelay TimeSpan

How long to wait to initially invoke the ticker.

periodicDelay TimeSpan

How often to invoke the ticker.

state TState
queueOnGameThread bool

Callback will always be fired on the game thread (if it exists).

onTick TickerCallback<ILoopTicker<TState>>

Callback since the event being invoked now would mean you couldn't subscribe to the event first.

Returns

ILoopTicker<TState>

Type Parameters

TState