2019-01-24 17:43:03 +09:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
2018-06-08 11:41:54 +09:00
|
|
|
|
using osu.Game.Online.API.Requests.Responses;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Online.API.Requests
|
|
|
|
|
{
|
2019-03-27 17:08:40 +09:00
|
|
|
|
public class GetUserScoresRequest : APIRequest<List<APILegacyScoreInfo>>
|
2018-04-13 18:19:50 +09:00
|
|
|
|
{
|
|
|
|
|
private readonly long userId;
|
|
|
|
|
private readonly ScoreType type;
|
|
|
|
|
private readonly int offset;
|
|
|
|
|
|
|
|
|
|
public GetUserScoresRequest(long userId, ScoreType type, int offset = 0)
|
|
|
|
|
{
|
|
|
|
|
this.userId = userId;
|
|
|
|
|
this.type = type;
|
|
|
|
|
this.offset = offset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
|
2018-07-25 07:37:05 +02:00
|
|
|
|
protected override string Target => $@"users/{userId}/scores/{type.ToString().ToLowerInvariant()}?offset={offset}";
|
2018-04-13 18:19:50 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum ScoreType
|
|
|
|
|
{
|
|
|
|
|
Best,
|
|
|
|
|
Firsts,
|
|
|
|
|
Recent
|
|
|
|
|
}
|
|
|
|
|
}
|