2019-01-24 08:43:03 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2022-06-17 07:37:17 +00:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2017-08-22 07:46:12 +00:00
|
|
|
|
using System;
|
2018-06-15 13:10:57 +00:00
|
|
|
|
using System.Collections.Generic;
|
2017-05-18 06:05:45 +00:00
|
|
|
|
using osu.Game.Rulesets.Objects;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-05-18 06:05:45 +00:00
|
|
|
|
namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Generator to create a pattern <see cref="Pattern"/> from a hit object.
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal abstract class PatternGenerator
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The last pattern.
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected readonly Pattern PreviousPattern;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-05-18 06:05:45 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The hit object to create the pattern for.
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected readonly HitObject HitObject;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-05-18 06:05:45 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The beatmap which <see cref="HitObject"/> is a part of.
|
|
|
|
|
/// </summary>
|
2018-01-03 09:44:25 +00:00
|
|
|
|
protected readonly ManiaBeatmap Beatmap;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2018-01-03 09:44:25 +00:00
|
|
|
|
protected readonly int TotalColumns;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2018-01-03 09:44:25 +00:00
|
|
|
|
protected PatternGenerator(HitObject hitObject, ManiaBeatmap beatmap, Pattern previousPattern)
|
2017-05-18 06:05:45 +00:00
|
|
|
|
{
|
2017-08-22 07:46:12 +00:00
|
|
|
|
if (hitObject == null) throw new ArgumentNullException(nameof(hitObject));
|
|
|
|
|
if (beatmap == null) throw new ArgumentNullException(nameof(beatmap));
|
|
|
|
|
if (previousPattern == null) throw new ArgumentNullException(nameof(previousPattern));
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-05-18 06:05:45 +00:00
|
|
|
|
HitObject = hitObject;
|
|
|
|
|
Beatmap = beatmap;
|
2017-08-22 07:22:40 +00:00
|
|
|
|
PreviousPattern = previousPattern;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2018-01-03 09:44:25 +00:00
|
|
|
|
TotalColumns = Beatmap.TotalColumns;
|
2017-05-18 06:05:45 +00:00
|
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-05-18 06:05:45 +00:00
|
|
|
|
/// <summary>
|
2018-06-15 13:10:57 +00:00
|
|
|
|
/// Generates the patterns for <see cref="HitObject"/>, each filled with hit objects.
|
2017-05-18 06:05:45 +00:00
|
|
|
|
/// </summary>
|
2018-06-15 13:10:57 +00:00
|
|
|
|
/// <returns>The <see cref="Pattern"/>s containing the hit objects.</returns>
|
|
|
|
|
public abstract IEnumerable<Pattern> Generate();
|
2017-05-18 06:05:45 +00:00
|
|
|
|
}
|
|
|
|
|
}
|