Move sett from EndTime to Duration

This commit is contained in:
Dean Herbert
2020-05-27 12:37:44 +09:00
parent ad10a7f0b2
commit b8e0a6f127
17 changed files with 50 additions and 50 deletions

View File

@ -19,14 +19,14 @@ namespace osu.Game.Rulesets.Osu.Objects
{
public class Slider : OsuHitObject, IHasCurve
{
public double EndTime
public double EndTime => StartTime + this.SpanCount() * Path.Distance / Velocity;
public double Duration
{
get => StartTime + this.SpanCount() * Path.Distance / Velocity;
get => EndTime - StartTime;
set => throw new System.NotSupportedException($"Adjust via {nameof(RepeatCount)} instead"); // can be implemented if/when needed.
}
public double Duration => EndTime - StartTime;
private readonly Cached<Vector2> endPositionCache = new Cached<Vector2>();
public override Vector2 EndPosition => endPositionCache.IsValid ? endPositionCache.Value : endPositionCache.Value = Position + this.CurvePositionAt(1);