// Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using System.Linq; namespace osu.Game.Beatmaps.Events { public class EventInfo { /// /// All the background events. /// public readonly List Backgrounds = new List(); /// /// All the break events. /// public readonly List Breaks = new List(); /// /// Total duration of all breaks. /// public double TotalBreakTime => Breaks.Sum(b => b.Duration); /// /// Retrieves the active background at a time. /// /// The time to retrieve the background at. /// The background. public BackgroundEvent BackgroundAt(double time) => Backgrounds.FirstOrDefault(b => b.StartTime <= time); } }