mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 07:22:54 +08:00
Simplify GetMaximumAchievableCombo further
This commit is contained in:
parent
423f6f90f2
commit
d75543ad68
@ -107,11 +107,8 @@ namespace osu.Game.Scoring
|
|||||||
/// Retrieves the maximum achievable combo for the provided score.
|
/// Retrieves the maximum achievable combo for the provided score.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="score">The <see cref="ScoreInfo"/> to compute the maximum achievable combo for.</param>
|
/// <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>
|
/// <returns>The maximum achievable combo.</returns>
|
||||||
public int GetMaximumAchievableCombo([NotNull] ScoreInfo score)
|
public int GetMaximumAchievableCombo([NotNull] ScoreInfo score) => score.MaximumStatistics.Where(kvp => kvp.Key.AffectsCombo()).Sum(kvp => kvp.Value);
|
||||||
{
|
|
||||||
return Enum.GetValues(typeof(HitResult)).OfType<HitResult>().Where(r => r.AffectsCombo()).Select(r => score.Statistics.GetValueOrDefault(r)).Sum();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides the total score of a <see cref="ScoreInfo"/>. Responds to changes in the currently-selected <see cref="ScoringMode"/>.
|
/// Provides the total score of a <see cref="ScoreInfo"/>. Responds to changes in the currently-selected <see cref="ScoringMode"/>.
|
||||||
|
Loading…
Reference in New Issue
Block a user