2017-05-17 17:42:48 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2017-05-22 09:12:33 +08:00
|
|
|
|
namespace osu.Game.Beatmaps.Timing
|
2017-05-17 17:42:48 +08:00
|
|
|
|
{
|
2017-05-22 09:12:33 +08:00
|
|
|
|
public class BreakPeriod
|
2017-05-17 17:42:48 +08:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The minimum duration required for a break to have any effect.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private const double min_break_duration = 650;
|
|
|
|
|
|
2017-05-22 09:12:33 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The break start time.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double StartTime;
|
|
|
|
|
|
2017-05-17 17:42:48 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The break end time.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public double EndTime;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-05-22 09:12:33 +08:00
|
|
|
|
/// The break duration.
|
2017-05-17 17:42:48 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
public double Duration => EndTime - StartTime;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2017-05-22 09:12:33 +08:00
|
|
|
|
/// Whether the break has any effect. Breaks that are too short are culled before they are added to the beatmap.
|
2017-05-17 17:42:48 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
public bool HasEffect => Duration >= min_break_duration;
|
|
|
|
|
}
|
|
|
|
|
}
|