From d75eb3a88ada68b6cc6f3598f653ae7ec2d5efcd Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 20 Nov 2024 15:46:45 +0900 Subject: [PATCH] Return mods from `CalculateAllLegacyCombinations` --- osu.Game/Rulesets/Difficulty/DifficultyCalculator.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Difficulty/DifficultyCalculator.cs b/osu.Game/Rulesets/Difficulty/DifficultyCalculator.cs index 39340776f0..718184e041 100644 --- a/osu.Game/Rulesets/Difficulty/DifficultyCalculator.cs +++ b/osu.Game/Rulesets/Difficulty/DifficultyCalculator.cs @@ -140,7 +140,7 @@ namespace osu.Game.Rulesets.Difficulty /// This can only be used to compute difficulties for legacy mod combinations. /// /// A collection of structures describing the difficulty of the beatmap for each mod combination. - public IEnumerable CalculateAllLegacyCombinations(CancellationToken cancellationToken = default) + public IEnumerable<(Mod[] Mods, IDifficultyAttributes Attributes)> CalculateAllLegacyCombinations(CancellationToken cancellationToken = default) { var rulesetInstance = ruleset.CreateInstance(); @@ -148,11 +148,13 @@ namespace osu.Game.Rulesets.Difficulty { Mod classicMod = rulesetInstance.CreateMod(); - var finalCombination = ModUtils.FlattenMod(combination); + IEnumerable finalCombination = ModUtils.FlattenMod(combination); if (classicMod != null) finalCombination = finalCombination.Append(classicMod); - yield return Calculate(finalCombination.ToArray(), cancellationToken); + Mod[] finalMods = finalCombination.ToArray(); + + yield return (finalMods, Calculate(finalMods, cancellationToken)); } }