mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Reimplement cursor as part of WebRequest extensions
> Added WebRequestExtensions > Moved Cursor request logic from SearchBeatmapSetsRequest
This commit is contained in:
25
osu.Game/Extensions/WebRequestExtensions.cs
Normal file
25
osu.Game/Extensions/WebRequestExtensions.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using osu.Framework.IO.Network;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace osu.Game.Extensions
|
||||
{
|
||||
public class Cursor
|
||||
{
|
||||
[JsonExtensionData]
|
||||
public IDictionary<string, JToken> Properties;
|
||||
}
|
||||
|
||||
public static class WebRequestExtensions
|
||||
{
|
||||
public static void AddCursor(this WebRequest webRequest, Cursor cursor)
|
||||
{
|
||||
cursor?.Properties.ForEach(x =>
|
||||
{
|
||||
webRequest.AddParameter("cursor[" + x.Key + "]", x.Value.ToString());
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user