// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using osu.Game.Screens.Play; namespace osu.Game.Beatmaps.Timing { public class BreakPeriod { /// /// The minimum duration required for a break to have any effect. /// public const double MIN_BREAK_DURATION = 650; /// /// The break start time. /// public double StartTime; /// /// The break end time. /// public double EndTime; /// /// The break duration. /// public double Duration => EndTime - StartTime; /// /// Whether the break has any effect. /// public bool HasEffect => Duration >= MIN_BREAK_DURATION; /// /// Constructs a new break period. /// /// The start time of the break period. /// The end time of the break period. public BreakPeriod(double startTime, double endTime) { StartTime = startTime; EndTime = endTime; } /// /// Whether this break contains a specified time. /// /// The time to check in milliseconds. /// Whether the time falls within this . public bool Contains(double time) => time >= StartTime && time <= EndTime - BreakOverlay.BREAK_FADE_DURATION; } }