Package de.Keyle.MyPet.api.gui
Interface SoundSpec
- All Known Implementing Classes:
SoundSpec.Choice,SoundSpec.Fixed,SoundSpec.Range,SoundSpec.Silent
public sealed interface SoundSpec
permits SoundSpec.Fixed, SoundSpec.Range, SoundSpec.Choice, SoundSpec.Silent
Polymorphic sound description: a fixed sound, a sound with pitch/volume ranges,
a uniform-random choice among other specs, or silence.
Resolves to an Adventure
Sound at fire time (or null if silent).-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordPicks uniformly among other specs on each play.static final recordA sound played at a fixed volume and pitch.static final recordA sound whose volume and pitch are sampled from a range on each play.static final recordPlays nothing. -
Method Summary
Modifier and TypeMethodDescription@Nullable Soundresolve(RandomGenerator random) Resolves this spec into a playable sound.
-
Method Details
-
resolve
Resolves this spec into a playable sound.- Parameters:
random- generator used to pick an option and sample any ranges- Returns:
- the sound to play, or
nullforSoundSpec.Silent
-