1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 08:53:20 +08:00

Make BeatmapSetInfo equatable

This commit is contained in:
naoey 2019-06-11 23:23:40 +05:30
parent ab27d82cd5
commit 41da491a7e
No known key found for this signature in database
GPG Key ID: 670DA9BE3DF7EE60
2 changed files with 4 additions and 2 deletions

View File

@ -9,7 +9,7 @@ using osu.Game.Database;
namespace osu.Game.Beatmaps
{
public class BeatmapSetInfo : IHasPrimaryKey, IHasFiles<BeatmapSetFileInfo>, ISoftDelete
public class BeatmapSetInfo : IHasPrimaryKey, IHasFiles<BeatmapSetFileInfo>, ISoftDelete, IEquatable<BeatmapSetInfo>
{
public int ID { get; set; }
@ -46,5 +46,7 @@ namespace osu.Game.Beatmaps
public override string ToString() => Metadata?.ToString() ?? base.ToString();
public bool Protected { get; set; }
public bool Equals(BeatmapSetInfo other) => OnlineBeatmapSetID == other?.OnlineBeatmapSetID;
}
}

View File

@ -16,7 +16,7 @@ namespace osu.Game.Online
/// A component which tracks a beatmap through potential download/import/deletion.
/// </summary>
public abstract class DownloadTrackingComposite<TModel, TModelManager> : CompositeDrawable
where TModel : class
where TModel : class, IEquatable<TModel>
where TModelManager : class, IDownloadModelManager<TModel>
{
public readonly Bindable<TModel> ModelInfo = new Bindable<TModel>();