1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 00:47:24 +08:00

Finally, remove the To* methods as they have no usages

This commit is contained in:
Dean Herbert 2021-11-01 15:37:38 +09:00
parent 08d94f864f
commit eb17d897a3
2 changed files with 0 additions and 50 deletions

View File

@ -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();

View File

@ -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,