1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-06 06:13:04 +08:00
osu-lazer/osu.Game.Rulesets.Osu/Edit/OsuDistanceSnapGrid.cs

30 lines
1.1 KiB
C#
Raw Normal View History

2019-10-11 16:13:28 +08:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Screens.Edit.Compose.Components;
namespace osu.Game.Rulesets.Osu.Edit
{
public class OsuDistanceSnapGrid : CircularDistanceSnapGrid
2019-10-11 16:13:28 +08:00
{
public OsuDistanceSnapGrid(OsuHitObject hitObject)
2019-10-11 16:13:28 +08:00
: base(hitObject, hitObject.StackedEndPosition)
{
2019-10-16 19:05:25 +08:00
Masking = true;
2019-10-11 16:13:28 +08:00
}
protected override float GetVelocity(double time, ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
{
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(time);
DifficultyControlPoint difficultyPoint = controlPointInfo.DifficultyPointAt(time);
double scoringDistance = OsuHitObject.BASE_SCORING_DISTANCE * difficulty.SliderMultiplier * difficultyPoint.SpeedMultiplier;
2019-10-11 16:13:28 +08:00
return (float)(scoringDistance / timingPoint.BeatLength);
}
}
}