1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 02:22:56 +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 bool RemoveBeatmapSet(BeatmapSetInfo beatmapSet) => items.RemoveBeatmapSet(beatmapSet);
public void RemoveBeatmapSet(BeatmapSetInfo beatmapSet) => items.RemoveBeatmapSet(beatmapSet);
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);
if (itemToRemove == null)
return false;
return items.Remove(itemToRemove);
if (itemToRemove != null)
items.Remove(itemToRemove);
}
public BeatmapSetInfo SelectedSet
@ -235,6 +234,7 @@ namespace osu.Game.Overlays.Music
private class ItemSearchContainer : FillFlowContainer<PlaylistItem>, IHasFilterableChildren
{
public IEnumerable<string> FilterTerms => new string[] { };
public bool MatchingFilter
{
set

View File

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