protected override void OnFree()
        {
            base.OnFree();

            PositionBindable.UnbindFrom(HitObject.PositionBindable);
            IndexInBeatmap.UnbindFrom(HitObject.IndexInBeatmapBindable);
        }
Beispiel #2
0
        /// <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;
        }
Beispiel #3
0
        protected override void OnFree()
        {
            base.OnFree();

            SingersBindable.UnbindFrom(HitObject.SingersBindable);
            LayoutIndexBindable.UnbindFrom(HitObject.LayoutIndexBindable);
            TranslateTextBindable.UnbindFrom(HitObject.TranslateTextBindable);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        /// <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;
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
 /// <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);
     }
 }
Beispiel #8
0
        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);
            }
        }
Beispiel #9
0
        /// <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);
            }
        }
Beispiel #10
0
        protected override void OnFree()
        {
            base.OnFree();

            SpeedMultiplierBindable.UnbindFrom(HitObject.SpeedMultiplierBindable);
        }
Beispiel #11
0
        protected override void OnFree()
        {
            base.OnFree();

            pathVersion.UnbindFrom(DrawableSlider.PathVersion);
        }
        protected override void OnFree()
        {
            base.OnFree();

            AngleBindable.UnbindFrom(HitObject.AngleBindable);
        }
Beispiel #13
0
        protected override void OnFree(HitObject hitObject)
        {
            base.OnFree(hitObject);

            pathVersion.UnbindFrom(drawableSlider.PathVersion);
        }