Skip to content

Commit

Permalink
Tidy up JudgementCounter classes
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Sep 18, 2024
1 parent 2d99364 commit c46e9cb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
18 changes: 18 additions & 0 deletions osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCount.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Bindables;
using osu.Framework.Localisation;
using osu.Game.Rulesets.Scoring;

namespace osu.Game.Screens.Play.HUD.JudgementCounter
{
public struct JudgementCount
{
public LocalisableString DisplayName { get; set; }

public HitResult[] Types { get; set; }

public BindableInt ResultCount { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,5 @@ private void updateCount(JudgementResult judgement, bool revert)
else
count.ResultCount.Value++;
}

public struct JudgementCount
{
public LocalisableString DisplayName { get; set; }

public HitResult[] Types { get; set; }

public BindableInt ResultCount { get; set; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Scoring;

namespace osu.Game.Screens.Play.HUD.JudgementCounter
Expand All @@ -19,16 +18,16 @@ public partial class JudgementCounter : VisibilityContainer
public BindableBool ShowName = new BindableBool();
public Bindable<FillDirection> Direction = new Bindable<FillDirection>();

public readonly JudgementCountController.JudgementCount Result;
public readonly JudgementCount Result;

public JudgementCounter(JudgementCountController.JudgementCount result) => Result = result;
public JudgementCounter(JudgementCount result) => Result = result;

public OsuSpriteText ResultName = null!;
private FillFlowContainer flowContainer = null!;
private JudgementRollingCounter counter = null!;

[BackgroundDependencyLoader]
private void load(OsuColour colours, IBindable<RulesetInfo> ruleset)
private void load(OsuColour colours)
{
AutoSizeAxes = Axes.Both;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private FillDirection getFillDirection(Direction flow)
}
}

private JudgementCounter createCounter(JudgementCountController.JudgementCount info) =>
private JudgementCounter createCounter(JudgementCount info) =>
new JudgementCounter(info)
{
State = { Value = Visibility.Hidden },
Expand Down

0 comments on commit c46e9cb

Please sign in to comment.