Skip to content

Commit

Permalink
Be more transparent about attached sound effects
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias <[email protected]>
  • Loading branch information
Hangman committed Aug 30, 2023
1 parent 6dbb7d2 commit f9f9bfb
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions core/src/main/java/de/pottgames/tuningfork/SoundEffect.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,32 @@ public void setEnvironmental(boolean value) {
}


/**
* Returns true if this sound effect is attached to one or more sources.
*
* @return true if attached, false otherwise
*/
public boolean isAttached() {
return !this.attachedSources.isEmpty();
}


/**
* Saves all {@link SoundSource}s that this SoundEffect is currently attached to in the list specified in the parameter.
*
* @param saveToList provide an array to save the sources to
*
* @return true if the effect is attached to at least one source
*/
public boolean getAttachedSources(Array<SoundSource> saveToList) {
if (this.attachedSources.isEmpty()) {
return false;
}
saveToList.addAll(this.attachedSources);
return true;
}


int getAuxSlotId() {
return this.auxSlotId;
}
Expand Down

0 comments on commit f9f9bfb

Please sign in to comment.