mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 08:03:52 +09:00
Finally, remove the To*
methods as they have no usages
This commit is contained in:
@ -81,34 +81,6 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
|
|
||||||
public double BPM { get; set; }
|
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
|
#region Implementation of IBeatmapInfo
|
||||||
|
|
||||||
public IBeatmapMetadataInfo Metadata => (BeatmapSet as IBeatmapSetInfo)?.Metadata ?? new BeatmapMetadata();
|
public IBeatmapMetadataInfo Metadata => (BeatmapSet as IBeatmapSetInfo)?.Metadata ?? new BeatmapMetadata();
|
||||||
|
@ -3,11 +3,9 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Game.Rulesets;
|
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
|
||||||
#nullable enable
|
#nullable enable
|
||||||
@ -121,26 +119,6 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
[JsonProperty(@"beatmaps")]
|
[JsonProperty(@"beatmaps")]
|
||||||
public APIBeatmap[] Beatmaps { get; set; } = Array.Empty<APIBeatmap>();
|
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
|
private BeatmapMetadata metadata => new BeatmapMetadata
|
||||||
{
|
{
|
||||||
Title = Title,
|
Title = Title,
|
||||||
|
Reference in New Issue
Block a user