1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-31 02:30:06 +08:00

Move scoring distance constant to a central/shared location

This commit is contained in:
Dean Herbert
2019-10-17 16:36:47 +09:00
Unverified
parent f92331531c
commit f3ed71d336
3 changed files with 10 additions and 12 deletions
@@ -10,11 +10,6 @@ namespace osu.Game.Rulesets.Osu.Edit
{
public class OsuDistanceSnapGrid : CircularDistanceSnapGrid
{
/// <summary>
/// Scoring distance with a speed-adjusted beat length of 1 second.
/// </summary>
private const float base_scoring_distance = 100;
public OsuDistanceSnapGrid(OsuHitObject hitObject)
: base(hitObject, hitObject.StackedEndPosition)
{
@@ -25,7 +20,7 @@ namespace osu.Game.Rulesets.Osu.Edit
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(time);
DifficultyControlPoint difficultyPoint = controlPointInfo.DifficultyPointAt(time);
double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * difficultyPoint.SpeedMultiplier;
double scoringDistance = OsuHitObject.BASE_SCORING_DISTANCE * difficulty.SliderMultiplier * difficultyPoint.SpeedMultiplier;
return (float)(scoringDistance / timingPoint.BeatLength);
}
@@ -14,8 +14,16 @@ namespace osu.Game.Rulesets.Osu.Objects
{
public abstract class OsuHitObject : HitObject, IHasComboInformation, IHasPosition
{
/// <summary>
/// The radius of hit objects (ie. the radius of a <see cref="HitCircle"/>).
/// </summary>
public const float OBJECT_RADIUS = 64;
/// <summary>
/// Scoring distance with a speed-adjusted beat length of 1 second (ie. the speed slider balls move through their track).
/// </summary>
internal const float BASE_SCORING_DISTANCE = 100;
public double TimePreempt = 600;
public double TimeFadeIn = 400;
+1 -6
View File
@@ -19,11 +19,6 @@ namespace osu.Game.Rulesets.Osu.Objects
{
public class Slider : OsuHitObject, IHasCurve
{
/// <summary>
/// Scoring distance with a speed-adjusted beat length of 1 second.
/// </summary>
private const float base_scoring_distance = 100;
public double EndTime => StartTime + this.SpanCount() * Path.Distance / Velocity;
public double Duration => EndTime - StartTime;
@@ -123,7 +118,7 @@ namespace osu.Game.Rulesets.Osu.Objects
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime);
DifficultyControlPoint difficultyPoint = controlPointInfo.DifficultyPointAt(StartTime);
double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * difficultyPoint.SpeedMultiplier;
double scoringDistance = BASE_SCORING_DISTANCE * difficulty.SliderMultiplier * difficultyPoint.SpeedMultiplier;
Velocity = scoringDistance / timingPoint.BeatLength;
TickDistance = scoringDistance / difficulty.SliderTickRate * TickDistanceMultiplier;