Skip to content

Commit

Permalink
Merge branch 'diff-pp-structs' of https://github.com/minisbett/osu in…
Browse files Browse the repository at this point in the history
…to diff-pp-structs
  • Loading branch information
minisbett committed Nov 21, 2024
2 parents d12fd89 + d75eb3a commit 808d44d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions osu.Game/Rulesets/Difficulty/DifficultyCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,21 @@ public List<TimedDifficultyAttributes> CalculateTimed([NotNull] IEnumerable<Mod>
/// 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();

foreach (var combination in CreateDifficultyAdjustmentModCombinations())
{
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));
}
}

Expand Down

0 comments on commit 808d44d

Please sign in to comment.