made the SampleControlPoint and DifficultyControlPoint obsolete

This commit is contained in:
OliBomby
2023-04-25 11:34:09 +02:00
parent 36113f60b7
commit a4c6850ab2
7 changed files with 105 additions and 43 deletions

View File

@ -9,10 +9,11 @@ using Newtonsoft.Json;
using osu.Game.Audio;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Beatmaps.Legacy;
namespace osu.Game.Rulesets.Objects.Legacy
{
internal abstract class ConvertSlider : ConvertHitObject, IHasPathWithRepeats, IHasLegacyLastTickOffset
internal abstract class ConvertSlider : ConvertHitObject, IHasPathWithRepeats, IHasLegacyLastTickOffset, IHasSliderVelocity
{
/// <summary>
/// Scoring distance with a speed-adjusted beat length of 1 second.
@ -40,17 +41,27 @@ namespace osu.Game.Rulesets.Objects.Legacy
public double Velocity = 1;
public double SliderVelocity { get; set; } = 1;
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty)
{
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime);
double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * DifficultyControlPoint.SliderVelocity;
double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * SliderVelocity;
Velocity = scoringDistance / timingPoint.BeatLength;
}
protected override void ApplyLegacyInfoToSelf(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty)
{
base.ApplyLegacyInfoToSelf(controlPointInfo, difficulty);
DifficultyControlPoint difficultyControlPoint = controlPointInfo is LegacyControlPointInfo legacyInfo ? legacyInfo.DifficultyPointAt(StartTime) : DifficultyControlPoint.DEFAULT;
SliderVelocity = difficultyControlPoint.SliderVelocity;
}
public double LegacyLastTickOffset => 36;
}
}