// 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 System.Linq; namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Rhythm.Data { /// /// Represents grouped by their 's interval. /// public class SamePatternsGroupedHitObjects { public IReadOnlyList Groups { get; } public SamePatternsGroupedHitObjects? Previous { get; } /// /// The between groups . /// If there is only one group, this will have the value of the first group's . /// public double GroupInterval => Groups.Count > 1 ? Groups[1].Interval : Groups[0].Interval; /// /// The ratio of between this and the previous . In the /// case where there is no previous , this will have a value of 1. /// public double IntervalRatio => GroupInterval / Previous?.GroupInterval ?? 1.0d; public TaikoDifficultyHitObject FirstHitObject => Groups[0].FirstHitObject; public IEnumerable AllHitObjects => Groups.SelectMany(hitObject => hitObject.HitObjects); public SamePatternsGroupedHitObjects(SamePatternsGroupedHitObjects? previous, List groups) { Previous = previous; Groups = groups; } } }