2018-06-08 11:04:33 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Rulesets;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Online.API.Requests.Responses
|
|
|
|
|
{
|
|
|
|
|
public class APIBeatmap : BeatmapMetadata
|
|
|
|
|
{
|
|
|
|
|
[JsonProperty(@"id")]
|
2018-06-08 11:46:34 +08:00
|
|
|
|
public int OnlineBeatmapID { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"beatmapset_id")]
|
|
|
|
|
public int OnlineBeatmapSetID { get; set; }
|
2018-06-08 11:04:33 +08:00
|
|
|
|
|
2018-09-13 17:57:33 +08:00
|
|
|
|
[JsonProperty(@"status")]
|
|
|
|
|
public BeatmapSetOnlineStatus Status { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"beatmapset")]
|
|
|
|
|
public APIBeatmapSet BeatmapSet { get; set; }
|
|
|
|
|
|
2018-06-08 11:04:33 +08:00
|
|
|
|
[JsonProperty(@"playcount")]
|
|
|
|
|
private int playCount { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"passcount")]
|
|
|
|
|
private int passCount { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"mode_int")]
|
|
|
|
|
private int ruleset { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"difficulty_rating")]
|
|
|
|
|
private double starDifficulty { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"drain")]
|
|
|
|
|
private float drainRate { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"cs")]
|
|
|
|
|
private float circleSize { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"ar")]
|
|
|
|
|
private float approachRate { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"accuracy")]
|
|
|
|
|
private float overallDifficulty { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"total_length")]
|
|
|
|
|
private double length { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"count_circles")]
|
|
|
|
|
private int circleCount { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"count_sliders")]
|
|
|
|
|
private int sliderCount { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"version")]
|
|
|
|
|
private string version { get; set; }
|
|
|
|
|
|
|
|
|
|
public BeatmapInfo ToBeatmap(RulesetStore rulesets)
|
|
|
|
|
{
|
|
|
|
|
return new BeatmapInfo
|
|
|
|
|
{
|
|
|
|
|
Metadata = this,
|
|
|
|
|
Ruleset = rulesets.GetRuleset(ruleset),
|
|
|
|
|
StarDifficulty = starDifficulty,
|
2018-06-08 11:46:34 +08:00
|
|
|
|
OnlineBeatmapID = OnlineBeatmapID,
|
2018-09-13 17:57:33 +08:00
|
|
|
|
Version = version,
|
|
|
|
|
Status = Status,
|
2018-06-08 14:26:27 +08:00
|
|
|
|
BeatmapSet = new BeatmapSetInfo
|
|
|
|
|
{
|
|
|
|
|
OnlineBeatmapSetID = OnlineBeatmapSetID,
|
2018-09-13 17:57:33 +08:00
|
|
|
|
Status = BeatmapSet?.Status ?? BeatmapSetOnlineStatus.None
|
2018-06-08 14:26:27 +08:00
|
|
|
|
},
|
2018-06-08 11:04:33 +08:00
|
|
|
|
BaseDifficulty = new BeatmapDifficulty
|
|
|
|
|
{
|
|
|
|
|
DrainRate = drainRate,
|
|
|
|
|
CircleSize = circleSize,
|
|
|
|
|
ApproachRate = approachRate,
|
|
|
|
|
OverallDifficulty = overallDifficulty,
|
|
|
|
|
},
|
|
|
|
|
OnlineInfo = new BeatmapOnlineInfo
|
|
|
|
|
{
|
|
|
|
|
PlayCount = playCount,
|
|
|
|
|
PassCount = passCount,
|
|
|
|
|
Length = length,
|
|
|
|
|
CircleCount = circleCount,
|
|
|
|
|
SliderCount = sliderCount,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|