From 5f689998930a5b37021a2ace9f6c76d69d07239d Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sat, 27 Jan 2024 20:44:34 +0300 Subject: [PATCH] Fix `TestSceneFailJudgement` asserts no longer being correct --- .../Visual/Gameplay/TestSceneFailJudgement.cs | 2 +- osu.Game/Rulesets/UI/Playfield.cs | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneFailJudgement.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneFailJudgement.cs index 4fb6e9783c..339746ac8b 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneFailJudgement.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneFailJudgement.cs @@ -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 }; diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index e9c35555c8..176223729a 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -78,6 +78,25 @@ namespace osu.Game.Rulesets.UI } } + /// + /// All the s contained in this and all . + /// + public IEnumerable AllEntries + { + get + { + if (HitObjectContainer == null) + return Enumerable.Empty(); + + var enumerable = HitObjectContainer.Entries; + + if (nestedPlayfields.Count != 0) + enumerable = enumerable.Concat(NestedPlayfields.SelectMany(p => p.AllEntries)); + + return enumerable; + } + } + /// /// All s nested inside this . ///