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

Merge branch 'diff-pp-structs' of https://github.com/minisbett/osu into diff-pp-structs

This commit is contained in:
minisbett 2024-11-21 19:46:34 +01:00
commit 808d44d2a6
No known key found for this signature in database
GPG Key ID: 2DB6D529C95A0403

View File

@ -140,7 +140,7 @@ namespace osu.Game.Rulesets.Difficulty
/// This can only be used to compute difficulties for legacy mod combinations.
/// </remarks>
/// <returns>A collection of structures describing the difficulty of the beatmap for each mod combination.</returns>
public IEnumerable<IDifficultyAttributes> 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<ModClassic>();
var finalCombination = ModUtils.FlattenMod(combination);
IEnumerable<Mod> 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));
}
}