1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 09:42:54 +08:00

Fix failing test

This commit is contained in:
Dean Herbert 2019-09-06 16:51:30 +09:00
parent 6ce36bd39e
commit b89fb5cdf7
2 changed files with 8 additions and 11 deletions

View File

@ -26,15 +26,7 @@ namespace osu.Game.Tests.Visual.Gameplay
{
AddUntilStep("wait for fail", () => Player.HasFailed);
AddUntilStep("wait for multiple judged objects", () => ((FailPlayer)Player).DrawableRuleset.Playfield.AllHitObjects.Count(h => h.AllJudged) > 1);
AddAssert("total judgements == 1", () =>
{
int count = 0;
foreach (var stat in (HitResult[])Enum.GetValues(typeof(HitResult)))
count += ((FailPlayer)Player).ScoreProcessor.GetStatistic(stat);
return count == 1;
});
AddAssert("total judgements == 1", () => ((FailPlayer)Player).ScoreProcessor.JudgedHits == 1);
}
private class FailPlayer : ReplayPlayer

View File

@ -92,6 +92,11 @@ namespace osu.Game.Rulesets.Scoring
/// </summary>
public virtual bool HasCompleted => false;
/// <summary>
/// The total number of judged <see cref="HitObject"/>s at the current point in time.
/// </summary>
public int JudgedHits { get; protected set; }
/// <summary>
/// Whether this ScoreProcessor has already triggered the failed state.
/// </summary>
@ -142,6 +147,8 @@ namespace osu.Game.Rulesets.Scoring
Rank.Value = ScoreRank.X;
HighestCombo.Value = 0;
JudgedHits = 0;
HasFailed = false;
}
@ -208,7 +215,6 @@ namespace osu.Game.Rulesets.Scoring
public sealed override bool HasCompleted => JudgedHits == MaxHits;
protected int MaxHits { get; private set; }
protected int JudgedHits { get; private set; }
private double maxHighestCombo;
@ -441,7 +447,6 @@ namespace osu.Game.Rulesets.Scoring
base.Reset(storeResults);
JudgedHits = 0;
baseScore = 0;
rollingMaxBaseScore = 0;
bonusScore = 0;