@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index / SlotChooser
Class: SlotChooser ​
Defined in: audio/soundBank.ts:66
Decides whether a slot sounds and which take: chance, cooldown, and never the same take twice running when there's another. No audio here, so it's testable.
Constructors ​
Constructor ​
ts
new SlotChooser(random?): SlotChooser;Defined in: audio/soundBank.ts:70
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
random | () => number | Math.random |
Returns ​
SlotChooser
Methods ​
choose() ​
ts
choose(
id,
slot,
now): SoundTake | null;Defined in: audio/soundBank.ts:73
The take to play now, or null to stay silent. now is in milliseconds.
Parameters ​
| Parameter | Type |
|---|---|
id | string |
slot | SoundSlot |
now | number |
Returns ​
SoundTake | null

