// Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using osu.Game.Beatmaps; using OpenTK; namespace osu.Game.Modes.Osu.Objects { public class Slider : OsuHitObject { public override double EndTime => StartTime + RepeatCount * Curve.Length / Velocity; public override Vector2 EndPosition => RepeatCount % 2 == 0 ? Position : Curve.PositionAt(1); private int stackHeight; public override int StackHeight { get { return stackHeight; } set { stackHeight = value; Curve.Offset = StackOffset; } } public List ControlPoints { get { return Curve.ControlPoints; } set { Curve.ControlPoints = value; } } public double Length { get { return Curve.Length; } set { Curve.Length = value; } } public CurveTypes CurveType { get { return Curve.CurveType; } set { Curve.CurveType = value; } } public double Velocity; public override void SetDefaultsFromBeatmap(Beatmap beatmap) { base.SetDefaultsFromBeatmap(beatmap); Velocity = 100 / beatmap.BeatLengthAt(StartTime, true) * beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier; } public int RepeatCount = 1; internal readonly SliderCurve Curve = new SliderCurve(); } public enum CurveTypes { Catmull, Bezier, Linear, PerfectCurve } }