1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-25 15:13:22 +08:00
osu-lazer/osu.Game/Online/API/Requests/GetSpotlightRankingsRequest.cs
2022-06-24 11:57:45 +02:00

37 lines
1.1 KiB
C#

// 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.
#nullable disable
using osu.Framework.IO.Network;
using osu.Game.Overlays.Rankings;
using osu.Game.Rulesets;
namespace osu.Game.Online.API.Requests
{
public class GetSpotlightRankingsRequest : GetRankingsRequest<GetSpotlightRankingsResponse>
{
private readonly int spotlight;
private readonly RankingsSortCriteria sort;
public GetSpotlightRankingsRequest(RulesetInfo ruleset, int spotlight, RankingsSortCriteria sort)
: base(ruleset)
{
this.spotlight = spotlight;
this.sort = sort;
}
protected override WebRequest CreateWebRequest()
{
var req = base.CreateWebRequest();
req.AddParameter("spotlight", spotlight.ToString());
req.AddParameter("filter", sort.ToString().ToLowerInvariant());
return req;
}
protected override string TargetPostfix() => "charts";
}
}