public SoundEffectInstance GetTrackedInstance(GameSound gameSound, SoundEffectFinished callback) { var result = this[gameSound].CreateInstance(); var tuple = new Tuple<GameSound, SoundEffectFinished>(gameSound, callback); this._trackingInstances.Add(result, tuple); return result; }
public void Play(GameSound gameSound, SoundEffectFinished callback) { if (callback == null) throw new ArgumentNullException("callback"); var soundEffectInstance = this._soundLibrary.GetTrackedInstance(gameSound, callback); soundEffectInstance.Play(); }
public void Play(GameSound gameSound, SoundEffectFinished callback) { if (callback == null) throw new ArgumentNullException("callback"); var args = new SoundEffectFinishedEventArgs(gameSound); callback(this, args); }