Esempio n. 1
0
        protected override void OnFree()
        {
            base.OnFree();

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

            SingersBindable.UnbindFrom(HitObject.SingersBindable);
            LayoutIndexBindable.UnbindFrom(HitObject.LayoutIndexBindable);
            TranslateTextBindable.UnbindFrom(HitObject.TranslateTextBindable);
        }
Esempio n. 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);
        }
Esempio n. 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;
        }
Esempio n. 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);
        }
Esempio n. 7
0
File: Mod.cs Progetto: vmaggioli/osu
 /// <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);
     }
 }
Esempio n. 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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 10
0
        protected override void OnFree()
        {
            base.OnFree();

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

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

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

            pathVersion.UnbindFrom(drawableSlider.PathVersion);
        }