// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps.Timing; using osu.Game.IO.Serialization; using osu.Game.Rulesets.Objects; namespace osu.Game.Beatmaps { public interface IBeatmap : IJsonSerializable { /// /// This beatmap's info. /// BeatmapInfo BeatmapInfo { get; set; } /// /// This beatmap's metadata. /// BeatmapMetadata Metadata { get; } /// /// The control points in this beatmap. /// ControlPointInfo ControlPointInfo { get; set; } /// /// The breaks in this beatmap. /// List Breaks { get; } /// /// Total amount of break time in the beatmap. /// double TotalBreakTime { get; } /// /// The hitobjects contained by this beatmap. /// IReadOnlyList HitObjects { get; } /// /// Returns statistics for the contained in this beatmap. /// IEnumerable GetStatistics(); /// /// Finds the most common beat length represented by the control points in this beatmap. /// double GetMostCommonBeatLength(); /// /// Returns the time on the given beat divisor closest to the given time. /// /// The time to find the closest snapped time to. /// The beat divisor to snap to. /// An optional reference point to use for timing point lookup. int ClosestSnapTime(double time, int beatDivisor, double? referenceTime = null); /// /// Returns the time on any valid beat divisor closest to the given time. /// /// The time to find the closest snapped time to. /// An optional reference point to use for timing point lookup. int ClosestSnapTime(double time, double? referenceTime = null); /// /// Returns the beat snap divisor closest to the given time. If two are equally close, the smallest is returned. /// /// The time to find the closest beat snap divisor to. /// An optional reference point to use for timing point lookup. int ClosestBeatDivisor(double time, double? referenceTime = null); /// /// Creates a shallow-clone of this beatmap and returns it. /// /// The shallow-cloned beatmap. IBeatmap Clone(); } public interface IBeatmap : IBeatmap where T : HitObject { /// /// The hitobjects contained by this beatmap. /// new IReadOnlyList HitObjects { get; } } }