mirror of
https://github.com/ppy/osu.git
synced 2025-03-16 04:57:19 +08:00
Add missing APIUser
comparison method
This commit is contained in:
parent
fbc46941fa
commit
2cbdac91ad
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
@ -85,6 +86,14 @@ namespace osu.Game.Extensions
|
|||||||
/// <returns>Whether online IDs match. If either instance is missing an online ID, this will return false.</returns>
|
/// <returns>Whether online IDs match. If either instance is missing an online ID, this will return false.</returns>
|
||||||
public static bool MatchesOnlineID(this IRulesetInfo? instance, IRulesetInfo? other) => matchesOnlineID(instance, other);
|
public static bool MatchesOnlineID(this IRulesetInfo? instance, IRulesetInfo? other) => matchesOnlineID(instance, other);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check whether the online ID of two <see cref="APIUser"/>s match.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="instance">The instance to compare.</param>
|
||||||
|
/// <param name="other">The other instance to compare against.</param>
|
||||||
|
/// <returns>Whether online IDs match. If either instance is missing an online ID, this will return false.</returns>
|
||||||
|
public static bool MatchesOnlineID(this APIUser? instance, APIUser? other) => matchesOnlineID(instance, other);
|
||||||
|
|
||||||
private static bool matchesOnlineID(this IHasOnlineID<long>? instance, IHasOnlineID<long>? other)
|
private static bool matchesOnlineID(this IHasOnlineID<long>? instance, IHasOnlineID<long>? other)
|
||||||
{
|
{
|
||||||
if (instance == null || other == null)
|
if (instance == null || other == null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user