Fix and refactor star difficulty calculation boilerplate

Moves star difficulty calculation entry-point to Beatmap, and sets
star difficulty at the correct place for song select to display.
This commit is contained in:
Thomas Müller
2017-02-24 19:36:17 +01:00
parent edbd27210b
commit f7d985fe18
9 changed files with 20 additions and 22 deletions

View File

@ -325,11 +325,7 @@ namespace osu.Game.Screens.Select
if (b.Metadata == null) b.Metadata = beatmapSet.Metadata;
});
foreach (var b in beatmapSet.Beatmaps)
b.ComputeDifficulty(database);
beatmapSet.Beatmaps = beatmapSet.Beatmaps.OrderBy(b => b.StarDifficulty).ToList();
var group = new BeatmapGroup(database.GetWorkingBeatmap(beatmapSet.Beatmaps.FirstOrDefault()))
var group = new BeatmapGroup(beatmapSet, database)
{
SelectionChanged = selectionChanged,
StartRequested = b => footer.StartButton.TriggerClick()