diff --git a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs index 9b3da1b8a8..7cd78c8be7 100644 --- a/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs +++ b/osu.Game.Rulesets.Osu/Scoring/OsuScoreProcessor.cs @@ -9,7 +9,6 @@ using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; -using osu.Game.Scoring; namespace osu.Game.Rulesets.Osu.Scoring { @@ -22,7 +21,6 @@ namespace osu.Game.Rulesets.Osu.Scoring private float hpDrainRate; - private readonly Dictionary scoreResultCounts = new Dictionary(); private readonly Dictionary comboResultCounts = new Dictionary(); protected override void ApplyBeatmap(Beatmap beatmap) @@ -35,21 +33,9 @@ namespace osu.Game.Rulesets.Osu.Scoring protected override void Reset(bool storeResults) { base.Reset(storeResults); - - scoreResultCounts.Clear(); comboResultCounts.Clear(); } - public override void PopulateScore(ScoreInfo score) - { - base.PopulateScore(score); - - score.Statistics[HitResult.Great] = scoreResultCounts.GetOrDefault(HitResult.Great); - score.Statistics[HitResult.Good] = scoreResultCounts.GetOrDefault(HitResult.Good); - score.Statistics[HitResult.Meh] = scoreResultCounts.GetOrDefault(HitResult.Meh); - score.Statistics[HitResult.Miss] = scoreResultCounts.GetOrDefault(HitResult.Miss); - } - private const double harshness = 0.01; protected override void ApplyResult(JudgementResult result) @@ -59,10 +45,7 @@ namespace osu.Game.Rulesets.Osu.Scoring var osuResult = (OsuJudgementResult)result; if (result.Type != HitResult.None) - { - scoreResultCounts[result.Type] = scoreResultCounts.GetOrDefault(result.Type) + 1; comboResultCounts[osuResult.ComboType] = comboResultCounts.GetOrDefault(osuResult.ComboType) + 1; - } switch (result.Type) { diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index ebcf78435c..b2a1bfaabd 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -2,8 +2,10 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Collections.Generic; using System.Diagnostics; using osu.Framework.Configuration; +using osu.Framework.Extensions; using osu.Framework.Extensions.TypeExtensions; using osu.Game.Beatmaps; using osu.Game.Rulesets.Judgements; @@ -155,6 +157,8 @@ namespace osu.Game.Rulesets.Scoring AllJudged?.Invoke(); } + private readonly Dictionary scoreResultCounts = new Dictionary(); + /// /// Retrieve a score populated with data for the current play this processor is responsible for. /// @@ -166,6 +170,13 @@ namespace osu.Game.Rulesets.Scoring score.Accuracy = Math.Round(Accuracy, 4); score.Rank = Rank; score.Date = DateTimeOffset.Now; + + score.Statistics[HitResult.Perfect] = scoreResultCounts.GetOrDefault(HitResult.Perfect); + score.Statistics[HitResult.Great] = scoreResultCounts.GetOrDefault(HitResult.Great); + score.Statistics[HitResult.Good] = scoreResultCounts.GetOrDefault(HitResult.Good); + score.Statistics[HitResult.Ok] = scoreResultCounts.GetOrDefault(HitResult.Ok); + score.Statistics[HitResult.Meh] = scoreResultCounts.GetOrDefault(HitResult.Meh); + score.Statistics[HitResult.Miss] = scoreResultCounts.GetOrDefault(HitResult.Miss); } public abstract double GetStandardisedScore(); @@ -275,6 +286,8 @@ namespace osu.Game.Rulesets.Scoring updateScore(); } + private readonly Dictionary scoreResultCounts = new Dictionary(); + /// /// Applies the score change of a to this . /// @@ -286,6 +299,9 @@ namespace osu.Game.Rulesets.Scoring JudgedHits++; + if (result.Type != HitResult.None) + scoreResultCounts[result.Type] = scoreResultCounts.GetOrDefault(result.Type) + 1; + if (result.Judgement.AffectsCombo) { switch (result.Type) @@ -362,6 +378,8 @@ namespace osu.Game.Rulesets.Scoring protected override void Reset(bool storeResults) { + scoreResultCounts.Clear(); + if (storeResults) { MaxHits = JudgedHits;