From 2770fb71b251fa315be1af4a83b1993ba5838e55 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Fri, 7 Feb 2020 21:12:21 +0100 Subject: [PATCH] Use SortedStatistics where needed --- osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs | 4 ++-- .../Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs | 4 +--- osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs index 7a17412722..758140a12d 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs @@ -82,7 +82,7 @@ private TableColumn[] createHeaders(ScoreInfo score) new TableColumn("max combo", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 70, maxSize: 90)) }; - foreach (var statistic in score.Statistics) + foreach (var statistic in score.SortedStatistics) columns.Add(new TableColumn(statistic.Key.GetDescription(), Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 50, maxSize: 70))); columns.AddRange(new[] @@ -150,7 +150,7 @@ private Drawable[] createContent(int index, ScoreInfo score) } }); - foreach (var kvp in score.Statistics) + foreach (var kvp in score.SortedStatistics) { content.Add(new OsuSpriteText { diff --git a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs index 8a17fef367..6c9f0b0321 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs @@ -99,9 +99,7 @@ public ScoreInfo Score maxComboColumn.Text = $@"{value.MaxCombo:N0}x"; ppColumn.Text = $@"{value.PP:N0}"; - statisticsColumns.ChildrenEnumerable = value.Statistics - .OrderByDescending(pair => pair.Key) - .Select(kvp => createStatisticsColumn(kvp.Key, kvp.Value)); + statisticsColumns.ChildrenEnumerable = value.SortedStatistics.Select(kvp => createStatisticsColumn(kvp.Key, kvp.Value)); modsColumn.Mods = value.Mods; } } diff --git a/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs b/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs index 43234c0b29..0aab067de1 100644 --- a/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs +++ b/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs @@ -188,7 +188,7 @@ private void load(OsuColour colours) }, }; - statisticsContainer.ChildrenEnumerable = Score.Statistics.OrderByDescending(p => p.Key).Select(s => new DrawableScoreStatistic(s)); + statisticsContainer.ChildrenEnumerable = Score.SortedStatistics.Select(s => new DrawableScoreStatistic(s)); } protected override void LoadComplete()