Sustained class final

A sound with a lifetime: it starts, it follows the thing making it, and it stops.

Not the same as a Heard, and the difference is the whole reason this class exists. A shot is over before the next step; a stone door grinding open runs for as long as the door moves, has to be repositioned while it runs, and has to be stopped by the same key that started it. Emitting that as a one-shot per step would be a door that stutters instead of grinds.

The lifetime is decided by the game's soundtrack rather than by whoever plays it, which is what makes SustainedVoices a player rather than a bookkeeper: it holds a voice per key and does exactly what each of these says.

Constructors

Sustained.begin(Object key, SoundDef sound, Vector3 at)
Starts sound for key at at, in world coordinates.
const
Sustained.end(Object key)
Stops key's voice.
const
Sustained.follow(Object key, Vector3 at)
Moves key's running voice to at, in world coordinates.
const

Properties

at → Vector3?
Where it is now. Null only when stopping.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Object
Whatever is making the noise. The thing itself, so two doors are two voices and the same door twice is one.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sound → SoundDef?
Only on Voice.begin: which sound to start.
final
what → Voice
Whether this starts, moves or stops the voice.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited