2016-09-02 17:35:49 +08:00
|
|
|
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2016-11-28 17:45:50 +08:00
|
|
|
|
using osu.Game.Beatmaps;
|
2016-12-06 20:14:38 +08:00
|
|
|
|
using OpenTK;
|
2016-09-02 17:35:49 +08:00
|
|
|
|
|
2016-11-14 17:54:24 +08:00
|
|
|
|
namespace osu.Game.Modes.Osu.Objects
|
2016-09-02 17:35:49 +08:00
|
|
|
|
{
|
2016-11-19 18:07:57 +08:00
|
|
|
|
public class Slider : OsuHitObject
|
2016-09-02 17:35:49 +08:00
|
|
|
|
{
|
2016-11-28 17:45:50 +08:00
|
|
|
|
public override double EndTime => StartTime + RepeatCount * Curve.Length / Velocity;
|
2016-11-28 14:31:54 +08:00
|
|
|
|
|
2016-12-06 20:14:38 +08:00
|
|
|
|
public override Vector2 EndPosition => RepeatCount % 2 == 0 ? Position : Curve.PositionAt(1);
|
|
|
|
|
|
2016-11-28 17:45:50 +08:00
|
|
|
|
public double Velocity;
|
|
|
|
|
|
|
|
|
|
public override void SetDefaultsFromBeatmap(Beatmap beatmap)
|
|
|
|
|
{
|
2016-12-11 17:11:22 +08:00
|
|
|
|
base.SetDefaultsFromBeatmap(beatmap);
|
|
|
|
|
|
2016-11-28 17:45:50 +08:00
|
|
|
|
Velocity = 100 / beatmap.BeatLengthAt(StartTime, true) * beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier;
|
|
|
|
|
}
|
2016-09-02 17:35:49 +08:00
|
|
|
|
|
|
|
|
|
public int RepeatCount;
|
2016-11-17 20:29:35 +08:00
|
|
|
|
|
|
|
|
|
public SliderCurve Curve;
|
2016-09-02 17:35:49 +08:00
|
|
|
|
}
|
2016-11-17 20:29:35 +08:00
|
|
|
|
|
|
|
|
|
public enum CurveTypes
|
|
|
|
|
{
|
|
|
|
|
Catmull,
|
|
|
|
|
Bezier,
|
|
|
|
|
Linear,
|
|
|
|
|
PerfectCurve
|
2016-11-28 11:15:25 +08:00
|
|
|
|
}
|
2016-09-02 17:35:49 +08:00
|
|
|
|
}
|