1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 09:02:58 +08:00

Tidy up events

This commit is contained in:
Dean Herbert 2017-12-04 20:30:56 +09:00
parent 22656233d3
commit a83add8540
2 changed files with 7 additions and 7 deletions

View File

@ -52,7 +52,7 @@ namespace osu.Game.Overlays.Music
} }
public void AddBeatmapSet(BeatmapSetInfo beatmapSet) => items.AddBeatmapSet(beatmapSet); public void AddBeatmapSet(BeatmapSetInfo beatmapSet) => items.AddBeatmapSet(beatmapSet);
public bool RemoveBeatmapSet(BeatmapSetInfo beatmapSet) => items.RemoveBeatmapSet(beatmapSet); public void RemoveBeatmapSet(BeatmapSetInfo beatmapSet) => items.RemoveBeatmapSet(beatmapSet);
public void Filter(string searchTerm) => items.SearchTerm = searchTerm; public void Filter(string searchTerm) => items.SearchTerm = searchTerm;
@ -108,12 +108,11 @@ namespace osu.Game.Overlays.Music
}); });
} }
public bool RemoveBeatmapSet(BeatmapSetInfo beatmapSet) public void RemoveBeatmapSet(BeatmapSetInfo beatmapSet)
{ {
var itemToRemove = items.FirstOrDefault(i => i.BeatmapSetInfo.ID == beatmapSet.ID); var itemToRemove = items.FirstOrDefault(i => i.BeatmapSetInfo.ID == beatmapSet.ID);
if (itemToRemove == null) if (itemToRemove != null)
return false; items.Remove(itemToRemove);
return items.Remove(itemToRemove);
} }
public BeatmapSetInfo SelectedSet public BeatmapSetInfo SelectedSet
@ -235,6 +234,7 @@ namespace osu.Game.Overlays.Music
private class ItemSearchContainer : FillFlowContainer<PlaylistItem>, IHasFilterableChildren private class ItemSearchContainer : FillFlowContainer<PlaylistItem>, IHasFilterableChildren
{ {
public IEnumerable<string> FilterTerms => new string[] { }; public IEnumerable<string> FilterTerms => new string[] { };
public bool MatchingFilter public bool MatchingFilter
{ {
set set

View File

@ -74,8 +74,8 @@ namespace osu.Game.Overlays.Music
}, },
}; };
beatmaps.BeatmapSetAdded += delegate (BeatmapSetInfo set) { list.AddBeatmapSet(set); }; beatmaps.BeatmapSetAdded += list.AddBeatmapSet;
beatmaps.BeatmapSetRemoved += delegate (BeatmapSetInfo set) { list.RemoveBeatmapSet(set); }; beatmaps.BeatmapSetRemoved += list.RemoveBeatmapSet;
list.BeatmapSets = beatmaps.GetAllUsableBeatmapSets(); list.BeatmapSets = beatmaps.GetAllUsableBeatmapSets();