Fix local scores potentially not being stable-sorted for leaderboard display

This commit is contained in:
Dean Herbert 2022-09-14 14:19:53 +09:00
parent ef6d60ffe9
commit bc07513c3c
1 changed files with 4 additions and 1 deletions

View File

@ -58,7 +58,10 @@ public ScoreInfo Query(Expression<Func<ScoreInfo, bool>> query)
/// <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>
public IEnumerable<ScoreInfo> OrderByTotalScore(IEnumerable<ScoreInfo> scores)
=> scores.OrderByDescending(s => GetTotalScore(s)).ThenBy(s => s.OnlineID);
=> scores.OrderByDescending(s => GetTotalScore(s))
.ThenBy(s => s.OnlineID)
// Local scores may not have an online ID. Fall back to date in these cases.
.ThenBy(s => s.Date);
/// <summary>
/// Retrieves a bindable that represents the total score of a <see cref="ScoreInfo"/>.