diff --git a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounter.cs b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounter.cs index ea6e9997e3..635b9220f4 100644 --- a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounter.cs +++ b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounter.cs @@ -18,9 +18,9 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter public BindableBool ShowName = new BindableBool(); public Bindable Direction = new Bindable(); - public readonly JudgementCounterInfo Result; + public readonly JudgementTally.JudgementCount Result; - public JudgementCounter(JudgementCounterInfo result) => Result = result; + public JudgementCounter(JudgementTally.JudgementCount result) => Result = result; public OsuSpriteText ResultName = null!; private FillFlowContainer flowContainer = null!; diff --git a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs index 4e2b2a10cd..7dd28b29b9 100644 --- a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs +++ b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterDisplay.cs @@ -124,7 +124,7 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter All } - private JudgementCounter createCounter(JudgementCounterInfo info) + private JudgementCounter createCounter(JudgementTally.JudgementCount info) { JudgementCounter counter = new JudgementCounter(info) { diff --git a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterInfo.cs b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterInfo.cs deleted file mode 100644 index 0237981db1..0000000000 --- a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementCounterInfo.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Framework.Bindables; -using osu.Game.Rulesets.Scoring; - -namespace osu.Game.Screens.Play.HUD.JudgementCounter -{ - public struct JudgementCounterInfo - { - public HitResult Type { get; set; } - - public BindableInt ResultCount { get; set; } - } -} diff --git a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementTally.cs b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementTally.cs index d8eac309aa..e9e3fde92a 100644 --- a/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementTally.cs +++ b/osu.Game/Screens/Play/HUD/JudgementCounter/JudgementTally.cs @@ -12,19 +12,23 @@ using osu.Game.Rulesets.Scoring; namespace osu.Game.Screens.Play.HUD.JudgementCounter { + /// + /// Keeps track of judgements for a current play session, exposing bindable counts which can + /// be used for display purposes. + /// public partial class JudgementTally : CompositeDrawable { [Resolved] private ScoreProcessor scoreProcessor { get; set; } = null!; - public List Results = new List(); + public List Results = new List(); [BackgroundDependencyLoader] private void load(IBindable ruleset) { foreach (var result in ruleset.Value.CreateInstance().GetHitResults()) { - Results.Add(new JudgementCounterInfo + Results.Add(new JudgementCount { Type = result.result, ResultCount = new BindableInt() @@ -42,8 +46,15 @@ namespace osu.Game.Screens.Play.HUD.JudgementCounter private void updateCount(JudgementResult judgement, bool revert) { - foreach (JudgementCounterInfo result in Results.Where(result => result.Type == judgement.Type)) + foreach (JudgementCount result in Results.Where(result => result.Type == judgement.Type)) result.ResultCount.Value = revert ? result.ResultCount.Value - 1 : result.ResultCount.Value + 1; } + + public struct JudgementCount + { + public HitResult Type { get; set; } + + public BindableInt ResultCount { get; set; } + } } }