//Copyright (c) 2007-2016 ppy Pty Ltd . //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using OpenTK.Graphics; using osu.Game.Beatmaps.Timing; using osu.Game.Database; using osu.Game.Modes.Objects; namespace osu.Game.Beatmaps { public class Beatmap { public BeatmapInfo BeatmapInfo { get; set; } public BeatmapMetadata Metadata => BeatmapInfo?.Metadata ?? BeatmapInfo?.BeatmapSet?.Metadata; public List HitObjects { get; set; } public List ControlPoints { get; set; } public List ComboColors { get; set; } public double BeatLengthAt(double time, bool applyMultipliers = false) { int point = 0; int samplePoint = 0; for (int i = 0; i < ControlPoints.Count; i++) if (ControlPoints[i].Time <= time) { if (ControlPoints[i].TimingChange) point = i; else samplePoint = i; } double mult = 1; if (applyMultipliers && samplePoint > point) mult = ControlPoints[samplePoint].VelocityAdjustment; return ControlPoints[point].BeatLength * mult; } } }