Split out index-only response

This commit is contained in:
smoogipoo 2020-07-31 17:40:58 +09:00
parent ccc377ae6a
commit 88e179d8aa
4 changed files with 29 additions and 14 deletions

View File

@ -111,7 +111,7 @@ private void bindHandler(double delay = 0)
void success()
{
r.TriggerSuccess(new MultiplayerScores { Scores = roomScores });
r.TriggerSuccess(new IndexedMultiplayerScores { Scores = roomScores });
roomsReceived = true;
}

View File

@ -12,7 +12,7 @@ namespace osu.Game.Online.Multiplayer
/// <summary>
/// Returns a list of scores for the specified playlist item.
/// </summary>
public class IndexPlaylistScoresRequest : APIRequest<MultiplayerScores>
public class IndexPlaylistScoresRequest : APIRequest<IndexedMultiplayerScores>
{
private readonly int roomId;
private readonly int playlistItemId;

View File

@ -0,0 +1,27 @@
// 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 JetBrains.Annotations;
using Newtonsoft.Json;
namespace osu.Game.Online.Multiplayer
{
/// <summary>
/// A <see cref="MultiplayerScores"/> object returned via a <see cref="IndexPlaylistScoresRequest"/>.
/// </summary>
public class IndexedMultiplayerScores : MultiplayerScores
{
/// <summary>
/// The total scores in the playlist item.
/// </summary>
[JsonProperty("total")]
public int? TotalScores { get; set; }
/// <summary>
/// The user's score, if any.
/// </summary>
[JsonProperty("user_score")]
[CanBeNull]
public MultiplayerScore UserScore { get; set; }
}
}

View File

@ -18,18 +18,6 @@ public class MultiplayerScores : ResponseWithCursor
[JsonProperty("scores")]
public List<MultiplayerScore> Scores { get; set; }
/// <summary>
/// The total scores in the playlist item. Only provided via <see cref="IndexPlaylistScoresRequest"/>.
/// </summary>
[JsonProperty("total")]
public int? TotalScores { get; set; }
/// <summary>
/// The user's score, if any. Only provided via <see cref="IndexPlaylistScoresRequest"/>.
/// </summary>
[JsonProperty("user_score")]
public MultiplayerScore UserScore { get; set; }
/// <summary>
/// The parameters to be used to fetch the next page.
/// </summary>