Move online metrics out of BeatmapSetInfo model

This commit is contained in:
Dean Herbert
2021-10-25 14:44:49 +09:00
parent 37ec4db017
commit 045dd94a6e
13 changed files with 86 additions and 73 deletions

View File

@ -10,7 +10,7 @@ using osu.Game.Rulesets;
namespace osu.Game.Online.API.Requests.Responses
{
public class APIBeatmap : IBeatmapInfo
public class APIBeatmap : IBeatmapInfo, IBeatmapOnlineInfo
{
[JsonProperty(@"id")]
public int OnlineID { get; set; }
@ -69,10 +69,10 @@ namespace osu.Game.Online.API.Requests.Responses
public string DifficultyName { get; set; } = string.Empty;
[JsonProperty(@"failtimes")]
private BeatmapMetrics? metrics { get; set; }
public BeatmapMetrics? Metrics { get; set; }
[JsonProperty(@"max_combo")]
private int? maxCombo { get; set; }
public int? MaxCombo { get; set; }
public virtual BeatmapInfo ToBeatmapInfo(RulesetStore rulesets)
{
@ -90,8 +90,8 @@ namespace osu.Game.Online.API.Requests.Responses
Status = Status,
MD5Hash = Checksum,
BeatmapSet = set,
Metrics = metrics,
MaxCombo = maxCombo,
Metrics = Metrics,
MaxCombo = MaxCombo,
BaseDifficulty = new BeatmapDifficulty
{
DrainRate = drainRate,

View File

@ -58,8 +58,8 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty(@"last_updated")]
public DateTimeOffset? LastUpdated { get; set; }
[JsonProperty(@"ratings")]
private int[] ratings { get; set; } = Array.Empty<int>();
[JsonProperty("ratings")]
public int[] Ratings { get; set; } = Array.Empty<int>();
[JsonProperty(@"track_id")]
public int? TrackId { get; set; }
@ -128,7 +128,6 @@ namespace osu.Game.Online.API.Requests.Responses
OnlineBeatmapSetID = OnlineID,
Metadata = metadata,
Status = Status,
Metrics = new BeatmapSetMetrics { Ratings = ratings },
OnlineInfo = this
};