mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Expand requests
This commit is contained in:
@ -2,7 +2,9 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.IO.Network;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Rulesets;
|
||||
|
||||
namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
@ -10,12 +12,24 @@ namespace osu.Game.Online.API.Requests
|
||||
{
|
||||
private readonly long userId;
|
||||
private readonly ScoreType type;
|
||||
private readonly RulesetInfo ruleset;
|
||||
|
||||
public GetUserScoresRequest(long userId, ScoreType type, int page = 0, int itemsPerPage = 5)
|
||||
public GetUserScoresRequest(long userId, ScoreType type, int page = 0, int itemsPerPage = 5, RulesetInfo ruleset = null)
|
||||
: base(page, itemsPerPage)
|
||||
{
|
||||
this.userId = userId;
|
||||
this.type = type;
|
||||
this.ruleset = ruleset;
|
||||
}
|
||||
|
||||
protected override WebRequest CreateWebRequest()
|
||||
{
|
||||
var req = base.CreateWebRequest();
|
||||
|
||||
if (ruleset != null)
|
||||
req.AddParameter("mode", ruleset.ShortName);
|
||||
|
||||
return req;
|
||||
}
|
||||
|
||||
protected override string Target => $@"users/{userId}/scores/{type.ToString().ToLowerInvariant()}";
|
||||
|
Reference in New Issue
Block a user