diff --git a/osu.Game/Rulesets/UI/HitObjectContainer.cs b/osu.Game/Rulesets/UI/HitObjectContainer.cs index 3a5e0b64ed..a0c95898be 100644 --- a/osu.Game/Rulesets/UI/HitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/HitObjectContainer.cs @@ -41,32 +41,6 @@ public class HitObjectContainer : LifetimeManagementContainer /// public event Action RevertResult; - /// - /// Invoked when a becomes used by a . - /// - /// - /// If this uses pooled objects, this represents the time when the s become alive. - /// - public event Action HitObjectUsageBegan; - - /// - /// Invoked when a becomes unused by a . - /// - /// - /// If this uses pooled objects, this represents the time when the s become dead. - /// - public event Action HitObjectUsageFinished; - - /// - /// The amount of time prior to the current time within which s should be considered alive. - /// - public double PastLifetimeExtension { get; set; } - - /// - /// The amount of time after the current time within which s should be considered alive. - /// - public double FutureLifetimeExtension { get; set; } - private readonly Dictionary startTimeMap = new Dictionary(); private readonly Dictionary drawableMap = new Dictionary(); private readonly LifetimeEntryManager lifetimeManager = new LifetimeEntryManager(); @@ -102,8 +76,6 @@ private void addDrawable(HitObjectLifetimeEntry entry) bindStartTime(drawable); AddInternal(drawableMap[entry] = drawable, false); - - HitObjectUsageBegan?.Invoke(entry.HitObject); } private void removeDrawable(HitObjectLifetimeEntry entry) @@ -119,8 +91,6 @@ private void removeDrawable(HitObjectLifetimeEntry entry) unbindStartTime(drawable); RemoveInternal(drawable); - - HitObjectUsageFinished?.Invoke(entry.HitObject); } #endregion @@ -173,7 +143,7 @@ public virtual void Clear(bool disposeChildren = true) unbindAllStartTimes(); } - protected override bool CheckChildrenLife() => base.CheckChildrenLife() | lifetimeManager.Update(Time.Current - PastLifetimeExtension, Time.Current + FutureLifetimeExtension); + protected override bool CheckChildrenLife() => base.CheckChildrenLife() | lifetimeManager.Update(Time.Current, Time.Current); private void onNewResult(DrawableHitObject d, JudgementResult r) => NewResult?.Invoke(d, r); private void onRevertResult(DrawableHitObject d, JudgementResult r) => RevertResult?.Invoke(d, r); diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index 2bd2bb9e06..cdaf9364af 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -29,22 +29,6 @@ public abstract class Playfield : CompositeDrawable /// public event Action RevertResult; - /// - /// Invoked when a becomes used by a . - /// - /// - /// If this uses pooled objects, this represents the time when the s become alive. - /// - public event Action HitObjectUsageBegan; - - /// - /// Invoked when a becomes unused by a . - /// - /// - /// If this uses pooled objects, this represents the time when the s become dead. - /// - public event Action HitObjectUsageFinished; - /// /// The contained in this Playfield. /// @@ -104,8 +88,6 @@ protected Playfield() { h.NewResult += (d, r) => NewResult?.Invoke(d, r); h.RevertResult += (d, r) => RevertResult?.Invoke(d, r); - h.HitObjectUsageBegan += o => HitObjectUsageBegan?.Invoke(o); - h.HitObjectUsageFinished += o => HitObjectUsageFinished?.Invoke(o); })); } @@ -198,41 +180,6 @@ protected virtual void OnHitObjectRemoved(HitObject hitObject) { } - /// - /// Sets whether to keep a given always alive within this or any nested . - /// - /// The to set. - /// Whether to keep always alive. - public void SetKeepAlive(HitObject hitObject, bool keepAlive) - { - if (lifetimeEntryMap.TryGetValue(hitObject, out var entry)) - { - entry.KeepAlive = keepAlive; - return; - } - - if (!nestedPlayfields.IsValueCreated) - return; - - foreach (var p in nestedPlayfields.Value) - p.SetKeepAlive(hitObject, keepAlive); - } - - /// - /// Keeps all s alive within this and all nested s. - /// - public void KeepAllAlive() - { - foreach (var (_, entry) in lifetimeEntryMap) - entry.KeepAlive = true; - - if (!nestedPlayfields.IsValueCreated) - return; - - foreach (var p in nestedPlayfields.Value) - p.KeepAllAlive(); - } - /// /// The cursor currently being used by this . May be null if no cursor is provided. /// @@ -258,8 +205,6 @@ protected void AddNested(Playfield otherPlayfield) otherPlayfield.NewResult += (d, r) => NewResult?.Invoke(d, r); otherPlayfield.RevertResult += (d, r) => RevertResult?.Invoke(d, r); - otherPlayfield.HitObjectUsageBegan += h => HitObjectUsageBegan?.Invoke(h); - otherPlayfield.HitObjectUsageFinished += h => HitObjectUsageFinished?.Invoke(h); nestedPlayfields.Value.Add(otherPlayfield); }