Record Class AudioPlayData
java.lang.Object
java.lang.Record
com.csse3200.game.cutscene.models.object.actiondata.AudioPlayData
- Record Components:
bus
- The audio bus of the soundsound
- The sound object containing sound info (path & id)volume
- The render volume of the sound [0.0 .. 1.0]pitch
- The render pitch of the sound [>=0]pan
- The render pan of the sound (which ear it comes out of) [-1.0 .. 1.0]loop
- If the sound loops on completion (for background music)await
- Wait for audio completion before continuing
- All Implemented Interfaces:
ActionData
public record AudioPlayData(AudioBus bus, Sound sound, Float volume, Float pitch, Float pan, boolean loop, boolean await)
extends Record
implements ActionData
Stores data for the audio.play event
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
await()
Returns the value of theawait
record component.bus()
Returns the value of thebus
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
loop()
Returns the value of theloop
record component.pan()
Returns the value of thepan
record component.pitch()
Returns the value of thepitch
record component.sound()
Returns the value of thesound
record component.final String
toString()
Returns a string representation of this record class.volume()
Returns the value of thevolume
record component.
-
Constructor Details
-
AudioPlayData
public AudioPlayData(AudioBus bus, Sound sound, Float volume, Float pitch, Float pan, boolean loop, boolean await) Creates an instance of aAudioPlayData
record class.- Parameters:
bus
- the value for thebus
record componentsound
- the value for thesound
record componentvolume
- the value for thevolume
record componentpitch
- the value for thepitch
record componentpan
- the value for thepan
record componentloop
- the value for theloop
record componentawait
- the value for theawait
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
bus
Returns the value of thebus
record component.- Returns:
- the value of the
bus
record component
-
sound
Returns the value of thesound
record component.- Returns:
- the value of the
sound
record component
-
volume
Returns the value of thevolume
record component.- Returns:
- the value of the
volume
record component
-
pitch
Returns the value of thepitch
record component.- Returns:
- the value of the
pitch
record component
-
pan
Returns the value of thepan
record component.- Returns:
- the value of the
pan
record component
-
loop
public boolean loop()Returns the value of theloop
record component.- Returns:
- the value of the
loop
record component
-
await
public boolean await()Returns the value of theawait
record component.- Returns:
- the value of the
await
record component
-