mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:23:22 +08:00
Add the ability to pass a CancellationToken
through DifficultyCalculator.CalculateAll
Was weirdly missing from this one method.
This commit is contained in:
parent
a62beb3c59
commit
f3e9fb76fc
@ -120,14 +120,14 @@ namespace osu.Game.Rulesets.Difficulty
|
||||
/// Calculates the difficulty of the beatmap using all mod combinations applicable to the beatmap.
|
||||
/// </summary>
|
||||
/// <returns>A collection of structures describing the difficulty of the beatmap for each mod combination.</returns>
|
||||
public IEnumerable<DifficultyAttributes> CalculateAll()
|
||||
public IEnumerable<DifficultyAttributes> CalculateAll(CancellationToken cancellationToken = default)
|
||||
{
|
||||
foreach (var combination in CreateDifficultyAdjustmentModCombinations())
|
||||
{
|
||||
if (combination is MultiMod multi)
|
||||
yield return Calculate(multi.Mods);
|
||||
yield return Calculate(multi.Mods, cancellationToken);
|
||||
else
|
||||
yield return Calculate(combination.Yield());
|
||||
yield return Calculate(combination.Yield(), cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user