mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Simplify OrderByTotalScore implementation
This commit is contained in:
@ -57,12 +57,7 @@ namespace osu.Game.Scoring
|
|||||||
/// <param name="scores">The array of <see cref="ScoreInfo"/>s to reorder.</param>
|
/// <param name="scores">The array of <see cref="ScoreInfo"/>s to reorder.</param>
|
||||||
/// <returns>The given <paramref name="scores"/> ordered by decreasing total score.</returns>
|
/// <returns>The given <paramref name="scores"/> ordered by decreasing total score.</returns>
|
||||||
public IEnumerable<ScoreInfo> OrderByTotalScore(IEnumerable<ScoreInfo> scores)
|
public IEnumerable<ScoreInfo> OrderByTotalScore(IEnumerable<ScoreInfo> scores)
|
||||||
{
|
=> scores.OrderByDescending(s => GetTotalScore(s)).ThenBy(s => s.OnlineID);
|
||||||
return scores.Select((score, index) => (score, totalScore: GetTotalScore(score)))
|
|
||||||
.OrderByDescending(g => g.totalScore)
|
|
||||||
.ThenBy(g => g.score.OnlineID)
|
|
||||||
.Select(g => g.score);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Retrieves a bindable that represents the total score of a <see cref="ScoreInfo"/>.
|
/// Retrieves a bindable that represents the total score of a <see cref="ScoreInfo"/>.
|
||||||
|
Reference in New Issue
Block a user