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 14:31:54 +08:00
|
|
|
|
using osu.Game.Database;
|
2016-11-28 17:45:50 +08:00
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using System;
|
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-11-28 17:45:50 +08:00
|
|
|
|
public double Velocity;
|
|
|
|
|
|
|
|
|
|
public override void SetDefaultsFromBeatmap(Beatmap beatmap)
|
|
|
|
|
{
|
|
|
|
|
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
|
|
|
|
}
|