Implemented sorting in TestCasePlaySong

This commit is contained in:
Alex Amadori
2017-02-18 15:11:40 +01:00
parent 1cd93f79b3
commit 6bbbbd8f96
4 changed files with 39 additions and 9 deletions

View File

@ -199,13 +199,12 @@ namespace osu.Game.Screens.Select
case FilterControl.SortMode.Difficulty:
groups.Sort((x, y) =>
{
// TODO: replace with star rating once implemented
/*TODO: replace with star rating once implemented
* Assumes BeatmapSets not to be grouped - or to be by difficulty,
* otherwise this sorting makes little sense - or does it? */
if (x.BeatmapSet.Beatmaps.First().BaseDifficulty.OverallDifficulty >
y.BeatmapSet.Beatmaps.First().BaseDifficulty.OverallDifficulty)
return 1;
else if (Equals(x.BeatmapSet.Beatmaps.First().BaseDifficulty.OverallDifficulty,
y.BeatmapSet.Beatmaps.First().BaseDifficulty.OverallDifficulty))
return 0;
else
return -1;
});

View File

@ -21,7 +21,15 @@ namespace osu.Game.Screens.Select
public Action FilterChanged;
public string Search => searchTextBox.Text;
public SortMode Sort { get; private set; } = SortMode.Title;
private SortMode sort = SortMode.Title;
public SortMode Sort {
get { return sort; }
set {
sort = value;
FilterChanged?.Invoke();
}
}
public Action Exit;
private SearchTextBox searchTextBox;

View File

@ -54,8 +54,12 @@ namespace osu.Game.Screens.Select
private Footer footer;
private FilterControl filter;
public FilterControl Filter {
get; private set;
}
Player player;
FilterControl filter;
private void start()
{