protected override void OnFree() { base.OnFree(); PositionBindable.UnbindFrom(HitObject.PositionBindable); IndexInBeatmap.UnbindFrom(HitObject.IndexInBeatmapBindable); }
/// <summary> /// Unregister a previously registered thread.<see cref="GameHost"/> /// </summary> /// <param name="thread">The thread.</param> public void UnregisterThread(GameThread thread) { threadRunner.RemoveThread(thread); IsActive.UnbindFrom(thread.IsActive); thread.UnhandledException = null; }
protected override void OnFree() { base.OnFree(); SingersBindable.UnbindFrom(HitObject.SingersBindable); LayoutIndexBindable.UnbindFrom(HitObject.LayoutIndexBindable); TranslateTextBindable.UnbindFrom(HitObject.TranslateTextBindable); }
protected override void OnFree(HitObject hitObject) { base.OnFree(hitObject); IndexInCurrentComboBindable.UnbindFrom(HitObject.IndexInCurrentComboBindable); PositionBindable.UnbindFrom(HitObject.PositionBindable); StackHeightBindable.UnbindFrom(HitObject.StackHeightBindable); ScaleBindable.UnbindFrom(HitObject.ScaleBindable); }
/// <summary> /// Unregister a previously registered thread.<see cref="GameHost"/> /// </summary> /// <param name="thread">The thread.</param> public void UnregisterThread(GameThread thread) { if (!threads.Remove(thread)) { return; } IsActive.UnbindFrom(thread.IsActive); thread.UnhandledException = null; }
protected override void OnFree() { base.OnFree(); TextBindable.UnbindFrom(HitObject.TextBindable); AlternativeTextBindable.UnbindFrom(HitObject.AlternativeTextBindable); SingersBindable.UnbindFrom(HitObject.SingersBindable); DisplayBindable.UnbindFrom(HitObject.DisplayBindable); ToneBindable.UnbindFrom(HitObject.ToneBindable); }
/// <summary> /// When creating copies or clones of a Mod, this method will be called /// to copy explicitly adjusted user settings from <paramref name="target"/>. /// The base implementation will transfer the value via <see cref="Bindable{T}.Parse"/> /// or by binding and unbinding (if <paramref name="source"/> is an <see cref="IBindable"/>) /// and should be called unless replaced with custom logic. /// </summary> /// <param name="target">The target bindable to apply the adjustment to.</param> /// <param name="source">The adjustment to apply.</param> internal virtual void CopyAdjustedSetting(IBindable target, object source) { if (source is IBindable sourceBindable) { // copy including transfer of default values. target.BindTo(sourceBindable); target.UnbindFrom(sourceBindable); } else { target.Parse(source); } }
protected override void OnFree() { base.OnFree(); TextBindable.UnbindFrom(HitObject.TextBindable); AlternativeTextBindable.UnbindFrom(HitObject.AlternativeTextBindable); DisplayBindable.UnbindFrom(HitObject.DisplayBindable); ToneBindable.UnbindFrom(HitObject.ToneBindable); if (HitObject.ParentLyric != null) { SingersBindable.UnbindFrom(HitObject.ParentLyric?.SingersBindable); } }
/// <summary> /// When creating copies or clones of a Mod, this method will be called /// to copy explicitly adjusted user settings from <paramref name="target"/>. /// The base implementation will transfer the value via <see cref="Bindable{T}.Parse"/> /// or by binding and unbinding (if <paramref name="source"/> is an <see cref="IBindable"/>) /// and should be called unless replaced with custom logic. /// </summary> /// <param name="target">The target bindable to apply the adjustment to.</param> /// <param name="source">The adjustment to apply.</param> internal virtual void CopyAdjustedSetting(IBindable target, object source) { if (source is IBindable sourceBindable) { // copy including transfer of default values. target.BindTo(sourceBindable); target.UnbindFrom(sourceBindable); } else { if (!(target is IParseable parseable)) { throw new InvalidOperationException($"Bindable type {target.GetType().ReadableName()} is not {nameof(IParseable)}."); } parseable.Parse(source); } }
protected override void OnFree() { base.OnFree(); SpeedMultiplierBindable.UnbindFrom(HitObject.SpeedMultiplierBindable); }
protected override void OnFree() { base.OnFree(); pathVersion.UnbindFrom(DrawableSlider.PathVersion); }
protected override void OnFree() { base.OnFree(); AngleBindable.UnbindFrom(HitObject.AngleBindable); }
protected override void OnFree(HitObject hitObject) { base.OnFree(hitObject); pathVersion.UnbindFrom(drawableSlider.PathVersion); }