1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 03:33:22 +08:00

Simplify GetMaximumAchievableCombo further

This commit is contained in:
Dan Balasescu 2022-08-29 15:36:10 +09:00
parent 423f6f90f2
commit d75543ad68

View File

@ -107,11 +107,8 @@ namespace osu.Game.Scoring
/// Retrieves the maximum achievable combo for the provided score.
/// </summary>
/// <param name="score">The <see cref="ScoreInfo"/> to compute the maximum achievable combo for.</param>
/// <returns>The maximum achievable combo. A <see langword="null"/> return value indicates the difficulty cache has failed to retrieve the combo.</returns>
public int GetMaximumAchievableCombo([NotNull] ScoreInfo score)
{
return Enum.GetValues(typeof(HitResult)).OfType<HitResult>().Where(r => r.AffectsCombo()).Select(r => score.Statistics.GetValueOrDefault(r)).Sum();
}
/// <returns>The maximum achievable combo.</returns>
public int GetMaximumAchievableCombo([NotNull] ScoreInfo score) => score.MaximumStatistics.Where(kvp => kvp.Key.AffectsCombo()).Sum(kvp => kvp.Value);
/// <summary>
/// Provides the total score of a <see cref="ScoreInfo"/>. Responds to changes in the currently-selected <see cref="ScoringMode"/>.