Class SoundCueGate

Namespace
SurvivorsMaker.Presentation
Assembly
SurvivorsMaker.Presentation.dll

Per-cue cooldown and concurrency limit, so hundreds of hits in one tick do not stack into noise. Times are any monotonic clock in seconds.

public sealed class SoundCueGate
Inheritance
SoundCueGate
Inherited Members

Constructors

SoundCueGate()

public SoundCueGate()

Methods

CanStart(string, float, float, int)

False while the cue is in its cooldown or already has maxConcurrent voices (0 = no limit).

public bool CanStart(string key, float now, float cooldown, int maxConcurrent)

Parameters

key string
now float
cooldown float
maxConcurrent int

Returns

bool

Clear()

public void Clear()

Playing(string, float)

public int Playing(string key, float now)

Parameters

key string
now float

Returns

int

Started(string, float, float)

Records a voice of key that started at now and lasts duration seconds.

public void Started(string key, float now, float duration)

Parameters

key string
now float
duration float

TryStart(string, float, float, int, float)

public bool TryStart(string key, float now, float cooldown, int maxConcurrent, float duration)

Parameters

key string
now float
cooldown float
maxConcurrent int
duration float

Returns

bool