// 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; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.UI; namespace osu.Game.Rulesets.Mania.Beatmaps { public class ManiaBeatmap : Beatmap { /// /// The definitions for each stage in a . /// public List Stages = new List(); /// /// Total number of columns represented by all stages in this . /// public int TotalColumns => Stages.Sum(g => g.Columns); /// /// The total number of columns that were present in this before any user adjustments. /// public readonly int OriginalTotalColumns; /// /// Creates a new . /// /// The initial stages. /// The total number of columns present before any user adjustments. Defaults to the total columns in . public ManiaBeatmap(StageDefinition defaultStage, int? originalTotalColumns = null) { Stages.Add(defaultStage); OriginalTotalColumns = originalTotalColumns ?? defaultStage.Columns; } public override IEnumerable GetStatistics() { int notes = HitObjects.Count(s => s is Note); int holdNotes = HitObjects.Count(s => s is HoldNote); return new[] { new BeatmapStatistic { Name = @"Note Count", CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Circles), Content = notes.ToString(), }, new BeatmapStatistic { Name = @"Hold Note Count", CreateIcon = () => new BeatmapStatisticIcon(BeatmapStatisticsIconType.Sliders), Content = holdNotes.ToString(), }, }; } } }