mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 18:42:56 +08:00
Finally, remove the To*
methods as they have no usages
This commit is contained in:
parent
08d94f864f
commit
eb17d897a3
@ -81,34 +81,6 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
|
||||
public double BPM { get; set; }
|
||||
|
||||
public virtual BeatmapInfo ToBeatmapInfo(RulesetStore rulesets)
|
||||
{
|
||||
var set = BeatmapSet?.ToBeatmapSet(rulesets);
|
||||
|
||||
return new BeatmapInfo
|
||||
{
|
||||
Metadata = set?.Metadata ?? new BeatmapMetadata(),
|
||||
Ruleset = rulesets.GetRuleset(RulesetID),
|
||||
StarDifficulty = StarRating,
|
||||
OnlineBeatmapID = OnlineID,
|
||||
Version = DifficultyName,
|
||||
// this is actually an incorrect mapping (Length is calculated as drain length in lazer's import process, see BeatmapManager.calculateLength).
|
||||
Length = Length,
|
||||
Status = Status,
|
||||
MD5Hash = Checksum,
|
||||
BeatmapSet = set,
|
||||
MaxCombo = MaxCombo,
|
||||
BaseDifficulty = new BeatmapDifficulty
|
||||
{
|
||||
DrainRate = DrainRate,
|
||||
CircleSize = CircleSize,
|
||||
ApproachRate = ApproachRate,
|
||||
OverallDifficulty = OverallDifficulty,
|
||||
},
|
||||
OnlineInfo = this,
|
||||
};
|
||||
}
|
||||
|
||||
#region Implementation of IBeatmapInfo
|
||||
|
||||
public IBeatmapMetadataInfo Metadata => (BeatmapSet as IBeatmapSetInfo)?.Metadata ?? new BeatmapMetadata();
|
||||
|
@ -3,11 +3,9 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Users;
|
||||
|
||||
#nullable enable
|
||||
@ -121,26 +119,6 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
[JsonProperty(@"beatmaps")]
|
||||
public APIBeatmap[] Beatmaps { get; set; } = Array.Empty<APIBeatmap>();
|
||||
|
||||
public virtual BeatmapSetInfo ToBeatmapSet(RulesetStore rulesets)
|
||||
{
|
||||
var beatmapSet = new BeatmapSetInfo
|
||||
{
|
||||
OnlineBeatmapSetID = OnlineID,
|
||||
Metadata = metadata,
|
||||
Status = Status,
|
||||
};
|
||||
|
||||
beatmapSet.Beatmaps = Beatmaps.Select(b =>
|
||||
{
|
||||
var beatmap = b.ToBeatmapInfo(rulesets);
|
||||
beatmap.BeatmapSet = beatmapSet;
|
||||
beatmap.Metadata = beatmapSet.Metadata;
|
||||
return beatmap;
|
||||
}).ToList();
|
||||
|
||||
return beatmapSet;
|
||||
}
|
||||
|
||||
private BeatmapMetadata metadata => new BeatmapMetadata
|
||||
{
|
||||
Title = Title,
|
||||
|
Loading…
Reference in New Issue
Block a user