Skip to content

Commit

Permalink
Update usages of RemoveInternal
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Aug 29, 2022
1 parent edab4ee commit 1d41485
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 16 deletions.
5 changes: 3 additions & 2 deletions osu.Desktop.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@
"osu.Game.Tournament.Tests\\osu.Game.Tournament.Tests.csproj",
"osu.Game.Tournament\\osu.Game.Tournament.csproj",
"osu.Game\\osu.Game.csproj",

"Templates\\Rulesets\\ruleset-empty\\osu.Game.Rulesets.EmptyFreeform\\osu.Game.Rulesets.EmptyFreeform.csproj",
"Templates\\Rulesets\\ruleset-empty\\osu.Game.Rulesets.EmptyFreeform.Tests\\osu.Game.Rulesets.EmptyFreeform.Tests.csproj",
"Templates\\Rulesets\\ruleset-example\\osu.Game.Rulesets.Pippidon\\osu.Game.Rulesets.Pippidon.csproj",
"Templates\\Rulesets\\ruleset-example\\osu.Game.Rulesets.Pippidon.Tests\\osu.Game.Rulesets.Pippidon.Tests.csproj",
"Templates\\Rulesets\\ruleset-scrolling-empty\\osu.Game.Rulesets.EmptyScrolling\\osu.Game.Rulesets.EmptyScrolling.csproj",
"Templates\\Rulesets\\ruleset-scrolling-empty\\osu.Game.Rulesets.EmptyScrolling.Tests\\osu.Game.Rulesets.EmptyScrolling.Tests.csproj",
"Templates\\Rulesets\\ruleset-scrolling-example\\osu.Game.Rulesets.Pippidon\\osu.Game.Rulesets.Pippidon.csproj",
"Templates\\Rulesets\\ruleset-scrolling-example\\osu.Game.Rulesets.Pippidon.Tests\\osu.Game.Rulesets.Pippidon.Tests.csproj"
"Templates\\Rulesets\\ruleset-scrolling-example\\osu.Game.Rulesets.Pippidon.Tests\\osu.Game.Rulesets.Pippidon.Tests.csproj",
"../osu-framework/osu.Framework/osu.Framework.csproj",
"../osu-framework/osu.Framework/osu.Framework.NativeLibs.csproj"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected EditablePath(Func<float, double> positionToTime)
public void UpdateFrom(ScrollingHitObjectContainer hitObjectContainer, JuiceStream hitObject)
{
while (path.Vertices.Count < InternalChildren.Count)
RemoveInternal(InternalChildren[^1]);
RemoveInternal(InternalChildren[^1], true);

while (InternalChildren.Count < path.Vertices.Count)
AddInternal(new VertexPiece());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void UpdateNestedObjectsFrom(ScrollingHitObjectContainer hitObjectContain
.Where(h => !(h is TinyDroplet)));

while (nestedHitObjects.Count < InternalChildren.Count)
RemoveInternal(InternalChildren[^1]);
RemoveInternal(InternalChildren[^1], true);

while (InternalChildren.Count < nestedHitObjects.Count)
AddInternal(new FruitOutline());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected override void OnFree()
// 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 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;

Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Graphics/Backgrounds/Background.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void BlurTo(Vector2 newBlurSigma, double duration = 0, Easing easing = Ea
{
if (bufferedContainer == null && newBlurSigma != Vector2.Zero)
{
RemoveInternal(Sprite);
RemoveInternal(Sprite, false);

AddInternal(bufferedContainer = new BufferedContainer(cachedFrameBuffer: true)
{
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Graphics/Containers/SectionsContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public Drawable ExpandableHeader
if (value == expandableHeader) return;

if (expandableHeader != null)
RemoveInternal(expandableHeader);
RemoveInternal(expandableHeader, false);

expandableHeader = value;

Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Rulesets/Judgements/DrawableJudgement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private void prepareDrawables()

// sub-classes might have added their own children that would be removed here if .InternalChild was used.
if (JudgementBody != null)
RemoveInternal(JudgementBody);
RemoveInternal(JudgementBody, true);

AddInternal(JudgementBody = new SkinnableDrawable(new GameplaySkinComponent<HitResult>(type), _ =>
CreateDefaultJudgement(type), confineMode: ConfineMode.NoScaling)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private void entryBecameDead(LifetimeEntry lifetimeEntry)
/// <remarks>
/// Invoked when the entry became dead.
/// </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)
{
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Rulesets/UI/HitObjectContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private void removeDrawable(DrawableHitObject drawable)

unbindStartTime(drawable);

RemoveInternal(drawable);
RemoveInternal(drawable, false);
}

#endregion
Expand Down
3 changes: 1 addition & 2 deletions osu.Game/Screens/Play/FailAnimation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ public void RemoveFilters(bool resetTrackFrequency = true)
if (filters.Parent == null)
return;

RemoveInternal(filters);
filters.Dispose();
RemoveInternal(filters, true);
}

protected override void Update()
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Screens/Ranking/ScorePanelTrackingContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void Detach()
if (InternalChildren.Count == 0)
throw new InvalidOperationException("Score panel container is not attached.");

RemoveInternal(Panel);
RemoveInternal(Panel, false);
}

/// <summary>
Expand Down
4 changes: 3 additions & 1 deletion osu.Game/osu.Game.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Realm" Version="10.15.1" />
<PackageReference Include="ppy.osu.Framework" Version="2022.819.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.819.0" />
<PackageReference Include="Sentry" Version="3.20.1" />
<PackageReference Include="SharpCompress" Version="0.32.2" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="TagLibSharp" Version="2.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\osu-framework\osu.Framework\osu.Framework.csproj" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions osu.iOS.props
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup Label="Package References">
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.819.0" />
<ProjectReference Include="../../osu-framework/osu.Framework.iOS/osu.Framework.iOS.csproj" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.819.0" />
</ItemGroup>
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net6.0) -->
Expand All @@ -84,7 +84,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.14" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="5.0.14" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="ppy.osu.Framework" Version="2022.819.0" />
<ProjectReference Include="../../osu-framework/osu.Framework/osu.Framework.csproj" />
<PackageReference Include="SharpCompress" Version="0.32.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
Expand Down
42 changes: 42 additions & 0 deletions osu.sln
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Pippidon"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Rulesets.Pippidon.Tests", "Templates\Rulesets\ruleset-scrolling-example\osu.Game.Rulesets.Pippidon.Tests\osu.Game.Rulesets.Pippidon.Tests.csproj", "{1743BF7C-E6AE-4A06-BAD9-166D62894303}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Framework", "..\osu-framework\osu.Framework\osu.Framework.csproj", "{4613575A-C208-445B-BCC2-763C81927C9D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Framework.iOS", "..\osu-framework\osu.Framework.iOS\osu.Framework.iOS.csproj", "{A9F39F37-E8A3-4393-8FEC-8C500A183BA1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Framework.NativeLibs", "..\osu-framework\osu.Framework.NativeLibs\osu.Framework.NativeLibs.csproj", "{C7DD3E2D-D2EA-40C2-8068-B152E39AC703}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -537,6 +543,42 @@ Global
{1743BF7C-E6AE-4A06-BAD9-166D62894303}.Release|iPhone.Build.0 = Release|Any CPU
{1743BF7C-E6AE-4A06-BAD9-166D62894303}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{1743BF7C-E6AE-4A06-BAD9-166D62894303}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{4613575A-C208-445B-BCC2-763C81927C9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4613575A-C208-445B-BCC2-763C81927C9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4613575A-C208-445B-BCC2-763C81927C9D}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{4613575A-C208-445B-BCC2-763C81927C9D}.Debug|iPhone.Build.0 = Debug|Any CPU
{4613575A-C208-445B-BCC2-763C81927C9D}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{4613575A-C208-445B-BCC2-763C81927C9D}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{4613575A-C208-445B-BCC2-763C81927C9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4613575A-C208-445B-BCC2-763C81927C9D}.Release|Any CPU.Build.0 = Release|Any CPU
{4613575A-C208-445B-BCC2-763C81927C9D}.Release|iPhone.ActiveCfg = Release|Any CPU
{4613575A-C208-445B-BCC2-763C81927C9D}.Release|iPhone.Build.0 = Release|Any CPU
{4613575A-C208-445B-BCC2-763C81927C9D}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{4613575A-C208-445B-BCC2-763C81927C9D}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{A9F39F37-E8A3-4393-8FEC-8C500A183BA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A9F39F37-E8A3-4393-8FEC-8C500A183BA1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A9F39F37-E8A3-4393-8FEC-8C500A183BA1}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{A9F39F37-E8A3-4393-8FEC-8C500A183BA1}.Debug|iPhone.Build.0 = Debug|Any CPU
{A9F39F37-E8A3-4393-8FEC-8C500A183BA1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{A9F39F37-E8A3-4393-8FEC-8C500A183BA1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{A9F39F37-E8A3-4393-8FEC-8C500A183BA1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A9F39F37-E8A3-4393-8FEC-8C500A183BA1}.Release|Any CPU.Build.0 = Release|Any CPU
{A9F39F37-E8A3-4393-8FEC-8C500A183BA1}.Release|iPhone.ActiveCfg = Release|Any CPU
{A9F39F37-E8A3-4393-8FEC-8C500A183BA1}.Release|iPhone.Build.0 = Release|Any CPU
{A9F39F37-E8A3-4393-8FEC-8C500A183BA1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{A9F39F37-E8A3-4393-8FEC-8C500A183BA1}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{C7DD3E2D-D2EA-40C2-8068-B152E39AC703}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7DD3E2D-D2EA-40C2-8068-B152E39AC703}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7DD3E2D-D2EA-40C2-8068-B152E39AC703}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{C7DD3E2D-D2EA-40C2-8068-B152E39AC703}.Debug|iPhone.Build.0 = Debug|Any CPU
{C7DD3E2D-D2EA-40C2-8068-B152E39AC703}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{C7DD3E2D-D2EA-40C2-8068-B152E39AC703}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{C7DD3E2D-D2EA-40C2-8068-B152E39AC703}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7DD3E2D-D2EA-40C2-8068-B152E39AC703}.Release|Any CPU.Build.0 = Release|Any CPU
{C7DD3E2D-D2EA-40C2-8068-B152E39AC703}.Release|iPhone.ActiveCfg = Release|Any CPU
{C7DD3E2D-D2EA-40C2-8068-B152E39AC703}.Release|iPhone.Build.0 = Release|Any CPU
{C7DD3E2D-D2EA-40C2-8068-B152E39AC703}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{C7DD3E2D-D2EA-40C2-8068-B152E39AC703}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 1d41485

Please sign in to comment.