1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Update usages of RemoveInternal

This commit is contained in:
Dean Herbert 2022-08-29 15:49:28 +09:00
parent a215d009fe
commit 105aa01e7d
10 changed files with 10 additions and 11 deletions

View File

@ -56,7 +56,7 @@ namespace osu.Game.Rulesets.Catch.Edit.Blueprints.Components
public void UpdateFrom(ScrollingHitObjectContainer hitObjectContainer, JuiceStream hitObject) public void UpdateFrom(ScrollingHitObjectContainer hitObjectContainer, JuiceStream hitObject)
{ {
while (path.Vertices.Count < InternalChildren.Count) while (path.Vertices.Count < InternalChildren.Count)
RemoveInternal(InternalChildren[^1]); RemoveInternal(InternalChildren[^1], true);
while (InternalChildren.Count < path.Vertices.Count) while (InternalChildren.Count < path.Vertices.Count)
AddInternal(new VertexPiece()); AddInternal(new VertexPiece());

View File

@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Catch.Edit.Blueprints.Components
.Where(h => !(h is TinyDroplet))); .Where(h => !(h is TinyDroplet)));
while (nestedHitObjects.Count < InternalChildren.Count) while (nestedHitObjects.Count < InternalChildren.Count)
RemoveInternal(InternalChildren[^1]); RemoveInternal(InternalChildren[^1], true);
while (InternalChildren.Count < nestedHitObjects.Count) while (InternalChildren.Count < nestedHitObjects.Count)
AddInternal(new FruitOutline()); AddInternal(new FruitOutline());

View File

@ -77,7 +77,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
// This is a bit ugly but we don't have the concept of InternalContent so it'll have to do for now. (https://github.com/ppy/osu-framework/issues/1690) // This is a bit ugly but we don't have the concept of InternalContent so it'll have to do for now. (https://github.com/ppy/osu-framework/issues/1690)
protected override void AddInternal(Drawable drawable) => shakeContainer.Add(drawable); protected override void AddInternal(Drawable drawable) => shakeContainer.Add(drawable);
protected override void ClearInternal(bool disposeChildren = true) => shakeContainer.Clear(disposeChildren); protected override void ClearInternal(bool disposeChildren = true) => shakeContainer.Clear(disposeChildren);
protected override bool RemoveInternal(Drawable drawable) => shakeContainer.Remove(drawable, true); protected override bool RemoveInternal(Drawable drawable, bool disposeImmediately) => shakeContainer.Remove(drawable, disposeImmediately);
protected sealed override double InitialLifetimeOffset => HitObject.TimePreempt; protected sealed override double InitialLifetimeOffset => HitObject.TimePreempt;

View File

@ -57,7 +57,7 @@ namespace osu.Game.Graphics.Backgrounds
{ {
if (bufferedContainer == null && newBlurSigma != Vector2.Zero) if (bufferedContainer == null && newBlurSigma != Vector2.Zero)
{ {
RemoveInternal(Sprite); RemoveInternal(Sprite, false);
AddInternal(bufferedContainer = new BufferedContainer(cachedFrameBuffer: true) AddInternal(bufferedContainer = new BufferedContainer(cachedFrameBuffer: true)
{ {

View File

@ -35,7 +35,7 @@ namespace osu.Game.Graphics.Containers
if (value == expandableHeader) return; if (value == expandableHeader) return;
if (expandableHeader != null) if (expandableHeader != null)
RemoveInternal(expandableHeader); RemoveInternal(expandableHeader, false);
expandableHeader = value; expandableHeader = value;

View File

@ -165,7 +165,7 @@ namespace osu.Game.Rulesets.Judgements
// sub-classes might have added their own children that would be removed here if .InternalChild was used. // sub-classes might have added their own children that would be removed here if .InternalChild was used.
if (JudgementBody != null) if (JudgementBody != null)
RemoveInternal(JudgementBody); RemoveInternal(JudgementBody, true);
AddInternal(JudgementBody = new SkinnableDrawable(new GameplaySkinComponent<HitResult>(type), _ => AddInternal(JudgementBody = new SkinnableDrawable(new GameplaySkinComponent<HitResult>(type), _ =>
CreateDefaultJudgement(type), confineMode: ConfineMode.NoScaling) CreateDefaultJudgement(type), confineMode: ConfineMode.NoScaling)

View File

@ -132,7 +132,7 @@ namespace osu.Game.Rulesets.Objects.Pooling
/// <remarks> /// <remarks>
/// Invoked when the entry became dead. /// Invoked when the entry became dead.
/// </remarks> /// </remarks>
protected virtual void RemoveDrawable(TEntry entry, TDrawable drawable) => RemoveInternal(drawable); protected virtual void RemoveDrawable(TEntry entry, TDrawable drawable) => RemoveInternal(drawable, false);
private void entryCrossedBoundary(LifetimeEntry lifetimeEntry, LifetimeBoundaryKind kind, LifetimeBoundaryCrossingDirection direction) private void entryCrossedBoundary(LifetimeEntry lifetimeEntry, LifetimeBoundaryKind kind, LifetimeBoundaryCrossingDirection direction)
{ {

View File

@ -124,7 +124,7 @@ namespace osu.Game.Rulesets.UI
unbindStartTime(drawable); unbindStartTime(drawable);
RemoveInternal(drawable); RemoveInternal(drawable, false);
} }
#endregion #endregion

View File

@ -166,8 +166,7 @@ namespace osu.Game.Screens.Play
if (filters.Parent == null) if (filters.Parent == null)
return; return;
RemoveInternal(filters); RemoveInternal(filters, true);
filters.Dispose();
} }
protected override void Update() protected override void Update()

View File

@ -34,7 +34,7 @@ namespace osu.Game.Screens.Ranking
if (InternalChildren.Count == 0) if (InternalChildren.Count == 0)
throw new InvalidOperationException("Score panel container is not attached."); throw new InvalidOperationException("Score panel container is not attached.");
RemoveInternal(Panel); RemoveInternal(Panel, false);
} }
/// <summary> /// <summary>