mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 16:27:26 +08:00
set Beatmap.BeatmapSet
to BeatmapSet
property in SoloScoreInfo
This commit is contained in:
parent
7a6666996f
commit
8791edf84c
@ -4,6 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using osu.Game.Beatmaps;
|
||||
@ -86,7 +87,19 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
public APIBeatmap? Beatmap { get; set; }
|
||||
|
||||
[JsonProperty("beatmapset")]
|
||||
public APIBeatmapSet? BeatmapSet { get; set; }
|
||||
[CanBeNull]
|
||||
public APIBeatmapSet BeatmapSet
|
||||
{
|
||||
set
|
||||
{
|
||||
// in the deserialisation case we need to ferry this data across.
|
||||
// the order of properties returned by the API guarantees that the beatmap is populated by this point.
|
||||
if (!(Beatmap is APIBeatmap apiBeatmap))
|
||||
throw new InvalidOperationException("Beatmap set metadata arrived before beatmap metadata in response");
|
||||
|
||||
apiBeatmap.BeatmapSet = value;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("pp")]
|
||||
public double? PP { get; set; }
|
||||
|
Loading…
Reference in New Issue
Block a user