public void Play(GameSound gameSound, SoundEffectFinished callback) { if (callback == null) throw new ArgumentNullException("callback"); var args = new SoundEffectFinishedEventArgs(gameSound); callback(this, args); }
public void CheckForStoppedInstances() { lock (this._trackingInstances) { var instancesToDispose = new List<SoundEffectInstance>(); foreach (var instance in this._trackingInstances.Where(i => i.Key.State == SoundState.Stopped)) { var gameSound = instance.Value.Item1; var callback = instance.Value.Item2; var args = new SoundEffectFinishedEventArgs(gameSound); callback(this, args); instancesToDispose.Add(instance.Key); } foreach (SoundEffectInstance instance in instancesToDispose) { this._trackingInstances.Remove(instance); instance.Dispose(); } } }
private void SoundEffectFinished(object sender, SoundEffectFinishedEventArgs args) { this.World.SetLevelReturnType(LevelReturnType.LostLife); }
private void SoundEffectFinished(object sender, SoundEffectFinishedEventArgs args) { this._world.SetLevelReturnType(LevelReturnType.FinishedLevel); }