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

make user lookup string public

This commit is contained in:
Davran Dilshat 2021-09-11 16:22:29 +01:00
parent c166f1a06a
commit 1b264a2dd0

View File

@ -8,7 +8,7 @@ namespace osu.Game.Online.API.Requests
{
public class GetUserRequest : APIRequest<User>
{
private readonly string lookup;
public readonly string Lookup;
public readonly RulesetInfo Ruleset;
private readonly LookupType lookupType;
@ -26,7 +26,7 @@ namespace osu.Game.Online.API.Requests
/// <param name="ruleset">The ruleset to get the user's info for.</param>
public GetUserRequest(long? userId = null, RulesetInfo ruleset = null)
{
lookup = userId.ToString();
Lookup = userId.ToString();
lookupType = LookupType.Id;
Ruleset = ruleset;
}
@ -38,12 +38,12 @@ namespace osu.Game.Online.API.Requests
/// <param name="ruleset">The ruleset to get the user's info for.</param>
public GetUserRequest(string username = null, RulesetInfo ruleset = null)
{
lookup = username;
Lookup = username;
lookupType = LookupType.Username;
Ruleset = ruleset;
}
protected override string Target => lookup != null ? $@"users/{lookup}/{Ruleset?.ShortName}?key={lookupType.ToString().ToLower()}" : $@"me/{Ruleset?.ShortName}";
protected override string Target => Lookup != null ? $@"users/{Lookup}/{Ruleset?.ShortName}?key={lookupType.ToString().ToLower()}" : $@"me/{Ruleset?.ShortName}";
private enum LookupType
{