1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 16:47:46 +08:00

Add HP and AR to LegacyBeatmapConversionDifficultyInfo

This commit is contained in:
Dan Balasescu 2024-03-28 22:30:39 +09:00
parent 21201e616d
commit 5febd40bd9
No known key found for this signature in database

View File

@ -18,6 +18,16 @@ namespace osu.Game.Rulesets.Scoring.Legacy
/// </summary>
public IRulesetInfo SourceRuleset { get; set; } = new RulesetInfo();
/// <summary>
/// The beatmap drain rate.
/// </summary>
public float DrainRate { get; set; }
/// <summary>
/// The beatmap approach rate.
/// </summary>
public float ApproachRate { get; set; }
/// <summary>
/// The beatmap circle size.
/// </summary>
@ -41,8 +51,6 @@ namespace osu.Game.Rulesets.Scoring.Legacy
/// </summary>
public int TotalObjectCount { get; set; }
float IBeatmapDifficultyInfo.DrainRate => 0;
float IBeatmapDifficultyInfo.ApproachRate => 0;
double IBeatmapDifficultyInfo.SliderMultiplier => 0;
double IBeatmapDifficultyInfo.SliderTickRate => 0;
@ -51,6 +59,8 @@ namespace osu.Game.Rulesets.Scoring.Legacy
public static LegacyBeatmapConversionDifficultyInfo FromBeatmap(IBeatmap beatmap) => new LegacyBeatmapConversionDifficultyInfo
{
SourceRuleset = beatmap.BeatmapInfo.Ruleset,
DrainRate = beatmap.Difficulty.DrainRate,
ApproachRate = beatmap.Difficulty.ApproachRate,
CircleSize = beatmap.Difficulty.CircleSize,
OverallDifficulty = beatmap.Difficulty.OverallDifficulty,
EndTimeObjectCount = beatmap.HitObjects.Count(h => h is IHasDuration),
@ -60,6 +70,8 @@ namespace osu.Game.Rulesets.Scoring.Legacy
public static LegacyBeatmapConversionDifficultyInfo FromBeatmapInfo(IBeatmapInfo beatmapInfo) => new LegacyBeatmapConversionDifficultyInfo
{
SourceRuleset = beatmapInfo.Ruleset,
DrainRate = beatmapInfo.Difficulty.DrainRate,
ApproachRate = beatmapInfo.Difficulty.ApproachRate,
CircleSize = beatmapInfo.Difficulty.CircleSize,
OverallDifficulty = beatmapInfo.Difficulty.OverallDifficulty,
EndTimeObjectCount = beatmapInfo.EndTimeObjectCount,