2020-02-04 13:04:06 +00: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.
|
|
|
|
|
|
|
|
|
|
using osu.Framework.IO.Network;
|
2020-07-14 15:09:09 +00:00
|
|
|
|
using osu.Game.Overlays.Rankings;
|
2020-02-04 13:04:06 +00:00
|
|
|
|
using osu.Game.Rulesets;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Online.API.Requests
|
|
|
|
|
{
|
|
|
|
|
public class GetSpotlightRankingsRequest : GetRankingsRequest<GetSpotlightRankingsResponse>
|
|
|
|
|
{
|
|
|
|
|
private readonly int spotlight;
|
2020-07-14 15:09:09 +00:00
|
|
|
|
private readonly RankingsSortCriteria sort;
|
2020-02-04 13:04:06 +00:00
|
|
|
|
|
2020-07-14 15:09:09 +00:00
|
|
|
|
public GetSpotlightRankingsRequest(RulesetInfo ruleset, int spotlight, RankingsSortCriteria sort)
|
2020-02-04 13:04:06 +00:00
|
|
|
|
: base(ruleset, 1)
|
|
|
|
|
{
|
|
|
|
|
this.spotlight = spotlight;
|
2020-07-14 15:09:09 +00:00
|
|
|
|
this.sort = sort;
|
2020-02-04 13:04:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override WebRequest CreateWebRequest()
|
|
|
|
|
{
|
|
|
|
|
var req = base.CreateWebRequest();
|
|
|
|
|
|
|
|
|
|
req.AddParameter("spotlight", spotlight.ToString());
|
2020-07-14 15:09:09 +00:00
|
|
|
|
req.AddParameter("filter", sort.ToString().ToLower());
|
2020-02-04 13:04:06 +00:00
|
|
|
|
|
|
|
|
|
return req;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override string TargetPostfix() => "charts";
|
|
|
|
|
}
|
|
|
|
|
}
|