2018-01-05 19:21:19 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-09-27 00:13:34 +08:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2018-01-24 16:44:50 +08:00
|
|
|
|
using System;
|
2018-01-22 19:36:38 +08:00
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
|
|
|
|
|
2017-09-27 00:13:34 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Osu.Objects
|
|
|
|
|
{
|
2017-09-27 23:28:44 +08:00
|
|
|
|
public class RepeatPoint : OsuHitObject
|
2017-09-27 00:13:34 +08:00
|
|
|
|
{
|
|
|
|
|
public int RepeatIndex { get; set; }
|
2018-01-23 16:04:45 +08:00
|
|
|
|
public double SpanDuration { get; set; }
|
2018-01-22 19:36:38 +08:00
|
|
|
|
|
|
|
|
|
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
|
|
|
|
|
{
|
|
|
|
|
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
|
|
|
|
|
|
|
|
|
|
// 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.
|
2018-01-24 16:44:50 +08:00
|
|
|
|
if (RepeatIndex > 0)
|
|
|
|
|
TimePreempt = Math.Min(SpanDuration * 2, TimePreempt);
|
2018-01-22 19:36:38 +08:00
|
|
|
|
}
|
2017-09-27 00:13:34 +08:00
|
|
|
|
}
|
|
|
|
|
}
|