mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Check equality by ID -> OnlineBeatmapSetID -> Hash -> ReferenceEquals
This commit is contained in:
@ -65,10 +65,19 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public bool Equals(BeatmapSetInfo other)
|
public bool Equals(BeatmapSetInfo other)
|
||||||
{
|
{
|
||||||
if (!OnlineBeatmapSetID.HasValue || !(other?.OnlineBeatmapSetID.HasValue ?? false))
|
if (other == null)
|
||||||
return ReferenceEquals(this, other);
|
return false;
|
||||||
|
|
||||||
return OnlineBeatmapSetID == other.OnlineBeatmapSetID;
|
if (ID != 0 && other.ID != 0)
|
||||||
|
return ID == other.ID;
|
||||||
|
|
||||||
|
if (OnlineBeatmapSetID.HasValue && other.OnlineBeatmapSetID.HasValue)
|
||||||
|
return OnlineBeatmapSetID == other.OnlineBeatmapSetID;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(Hash) && !string.IsNullOrEmpty(other.Hash))
|
||||||
|
return Hash == other.Hash;
|
||||||
|
|
||||||
|
return ReferenceEquals(this, other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user