Fix TestSceneFailJudgement asserts no longer being correct

This commit is contained in:
Salman Ahmed 2024-01-27 20:44:34 +03:00
parent a25be9927d
commit 5f68999893
2 changed files with 20 additions and 1 deletions

View File

@ -24,7 +24,7 @@ namespace osu.Game.Tests.Visual.Gameplay
AddUntilStep("player is playing", () => Player.LocalUserPlaying.Value);
AddUntilStep("wait for fail", () => Player.GameplayState.ShownFailAnimation);
AddAssert("player is not playing", () => !Player.LocalUserPlaying.Value);
AddUntilStep("wait for multiple judgements", () => ((FailPlayer)Player).ScoreProcessor.JudgedHits > 1);
AddUntilStep("wait for multiple judgements", () => ((FailPlayer)Player).DrawableRuleset.Playfield.AllEntries.Count(e => e.Judged) > 1);
AddAssert("total number of results == 1", () =>
{
var score = new ScoreInfo { Ruleset = Ruleset.Value };

View File

@ -78,6 +78,25 @@ namespace osu.Game.Rulesets.UI
}
}
/// <summary>
/// All the <see cref="HitObjectLifetimeEntry"/>s contained in this <see cref="Playfield"/> and all <see cref="NestedPlayfields"/>.
/// </summary>
public IEnumerable<HitObjectLifetimeEntry> AllEntries
{
get
{
if (HitObjectContainer == null)
return Enumerable.Empty<HitObjectLifetimeEntry>();
var enumerable = HitObjectContainer.Entries;
if (nestedPlayfields.Count != 0)
enumerable = enumerable.Concat(NestedPlayfields.SelectMany(p => p.AllEntries));
return enumerable;
}
}
/// <summary>
/// All <see cref="Playfield"/>s nested inside this <see cref="Playfield"/>.
/// </summary>