1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 03:25:11 +08:00

review changes

- use doubles instead of floats
- simplify logic
This commit is contained in:
Aergwyn 2018-01-24 09:44:50 +01:00
parent 4baadfdd16
commit 52c4d22c41
5 changed files with 10 additions and 9 deletions

View File

@ -56,7 +56,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
continue;
double endTime = (stackBaseObject as IHasEndTime)?.EndTime ?? stackBaseObject.StartTime;
float stackThreshold = objectN.TimePreempt * beatmap.BeatmapInfo?.StackLeniency ?? 0.7f;
double stackThreshold = objectN.TimePreempt * beatmap.BeatmapInfo?.StackLeniency ?? 0.7f;
if (objectN.StartTime - endTime > stackThreshold)
//We are no longer within stacking range of the next object.
@ -99,7 +99,7 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
OsuHitObject objectI = beatmap.HitObjects[i];
if (objectI.StackHeight != 0 || objectI is Spinner) continue;
float stackThreshold = objectI.TimePreempt * beatmap.BeatmapInfo?.StackLeniency ?? 0.7f;
double stackThreshold = objectI.TimePreempt * beatmap.BeatmapInfo?.StackLeniency ?? 0.7f;
/* If this object is a hitcircle, then we enter this "special" case.
* It either ends with a stack of hitcircles only, or a stack of hitcircles that are underneath a slider.

View File

@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Osu.Mods
public override string Description => @"Play with no approach circles and fading notes for a slight score advantage.";
public override double ScoreMultiplier => 1.06;
private const float fade_in_duration_multiplier = 0.4f;
private const double fade_in_duration_multiplier = 0.4;
private const double fade_out_duration_multiplier = 0.3;
public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)

View File

@ -20,8 +20,8 @@ namespace osu.Game.Rulesets.Osu.Objects
public double HitWindow100 = 80;
public double HitWindow300 = 30;
public float TimePreempt = 600;
public float TimeFadein = 400;
public double TimePreempt = 600;
public double TimeFadein = 400;
public Vector2 Position { get; set; }
public float X => Position.X;

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
@ -17,8 +18,8 @@ namespace osu.Game.Rulesets.Osu.Objects
// We want to show the first RepeatPoint as the TimePreempt dictates but on short (and possibly fast) sliders
// we may need to cut down this time on following RepeatPoints to only show up to two RepeatPoints at any given time.
if (RepeatIndex > 0 && TimePreempt > SpanDuration * 2)
TimePreempt = (float)SpanDuration * 2;
if (RepeatIndex > 0)
TimePreempt = Math.Min(SpanDuration * 2, TimePreempt);
}
}
}

View File

@ -61,9 +61,9 @@ namespace osu.Game.Rulesets.Osu.Objects
public int RepeatCount { get; set; }
/// <summary>
/// The length of one repeat if any repeats are present, otherwise it equals the <see cref="Duration"/>.
/// The length of one span of this <see cref="Slider"/>.
/// </summary>
public double SpanDuration => RepeatCount > 0 ? Distance / Velocity : Duration;
public double SpanDuration => Duration / this.SpanCount();
private int stackHeight;