From 2cbdac91ad02b84e9ec7c04685d6d55f2c574d92 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 16 Nov 2021 12:44:20 +0900 Subject: [PATCH] Add missing `APIUser` comparison method --- osu.Game/Extensions/ModelExtensions.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/osu.Game/Extensions/ModelExtensions.cs b/osu.Game/Extensions/ModelExtensions.cs index c8561ecdb3..3426484c14 100644 --- a/osu.Game/Extensions/ModelExtensions.cs +++ b/osu.Game/Extensions/ModelExtensions.cs @@ -3,6 +3,7 @@ using osu.Game.Beatmaps; using osu.Game.Database; +using osu.Game.Online.API.Requests.Responses; using osu.Game.Rulesets; using osu.Game.Scoring; using osu.Game.Users; @@ -85,6 +86,14 @@ public static string GetDisplayString(this object? model) /// Whether online IDs match. If either instance is missing an online ID, this will return false. public static bool MatchesOnlineID(this IRulesetInfo? instance, IRulesetInfo? other) => matchesOnlineID(instance, other); + /// + /// Check whether the online ID of two s match. + /// + /// The instance to compare. + /// The other instance to compare against. + /// Whether online IDs match. If either instance is missing an online ID, this will return false. + public static bool MatchesOnlineID(this APIUser? instance, APIUser? other) => matchesOnlineID(instance, other); + private static bool matchesOnlineID(this IHasOnlineID? instance, IHasOnlineID? other) { if (instance == null || other == null)