// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using System.Collections.Generic; using osu.Game.Rulesets.Objects; namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns { /// /// Generator to create a pattern from a hit object. /// internal abstract class PatternGenerator { /// /// The last pattern. /// protected readonly Pattern PreviousPattern; /// /// The hit object to create the pattern for. /// protected readonly HitObject HitObject; /// /// The beatmap which is a part of. /// protected readonly ManiaBeatmap Beatmap; protected readonly int TotalColumns; protected PatternGenerator(HitObject hitObject, ManiaBeatmap beatmap, Pattern previousPattern) { if (hitObject == null) throw new ArgumentNullException(nameof(hitObject)); if (beatmap == null) throw new ArgumentNullException(nameof(beatmap)); if (previousPattern == null) throw new ArgumentNullException(nameof(previousPattern)); HitObject = hitObject; Beatmap = beatmap; PreviousPattern = previousPattern; TotalColumns = Beatmap.TotalColumns; } /// /// Generates the patterns for , each filled with hit objects. /// /// The s containing the hit objects. public abstract IEnumerable Generate(); } }