1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-17 07:22:38 +08:00

Make BeatmapSetInfo equatable

This commit is contained in:
naoey
2019-06-11 23:23:40 +05:30
Unverified
parent ab27d82cd5
commit 41da491a7e
2 changed files with 4 additions and 2 deletions
+3 -1
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;
}
}
+1 -1
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>();