1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Avoid internal property by using ChildrenOfType

This commit is contained in:
ekrctb 2021-07-28 18:13:43 +09:00
parent 846f539428
commit 0bf04ece34
2 changed files with 7 additions and 7 deletions

View File

@ -130,7 +130,7 @@ namespace osu.Game.Rulesets.Catch.Tests
}
}
}, skin);
trails = catcherArea.CatcherTrails;
trails = catcherArea.ChildrenOfType<CatcherTrailDisplay>().Single();
});
AddStep("start hyper-dash", () =>

View File

@ -28,12 +28,12 @@ namespace osu.Game.Rulesets.Catch.UI
set => catcherContainer.Child = catcher = value;
}
internal CatcherTrailDisplay CatcherTrails { get; }
private readonly Container<Catcher> catcherContainer;
private readonly CatchComboDisplay comboDisplay;
private readonly CatcherTrailDisplay catcherTrails;
private Catcher catcher;
/// <summary>
@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.Catch.UI
Children = new Drawable[]
{
catcherContainer = new Container<Catcher> { RelativeSizeAxes = Axes.Both },
CatcherTrails = new CatcherTrailDisplay(),
catcherTrails = new CatcherTrailDisplay(),
comboDisplay = new CatchComboDisplay
{
RelativeSizeAxes = Axes.None,
@ -110,14 +110,14 @@ namespace osu.Game.Rulesets.Catch.UI
comboDisplay.X = Catcher.X;
if (!lastHyperDashState && Catcher.HyperDashing && Time.Elapsed > 0)
CatcherTrails.DisplayEndGlow(Catcher.CurrentState, Catcher.X, Catcher.BodyScale);
catcherTrails.DisplayEndGlow(Catcher.CurrentState, Catcher.X, Catcher.BodyScale);
if (Catcher.Dashing || Catcher.HyperDashing)
{
double generationInterval = Catcher.HyperDashing ? 25 : 50;
if (Time.Current - CatcherTrails.LastDashTrailTime >= generationInterval)
CatcherTrails.DisplayDashTrail(Catcher.CurrentState, Catcher.X, Catcher.BodyScale, Catcher.HyperDashing);
if (Time.Current - catcherTrails.LastDashTrailTime >= generationInterval)
catcherTrails.DisplayDashTrail(Catcher.CurrentState, Catcher.X, Catcher.BodyScale, Catcher.HyperDashing);
}
lastHyperDashState = Catcher.HyperDashing;