2018-01-05 19:21:19 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-05-18 14:05:45 +08:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2017-08-22 15:46:12 +08:00
|
|
|
|
using System;
|
2017-05-18 14:05:45 +08:00
|
|
|
|
using osu.Game.Rulesets.Objects;
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The hit object to create the pattern for.
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected readonly HitObject HitObject;
|
2017-05-18 16:00:11 +08:00
|
|
|
|
|
2017-05-18 14:05:45 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The beatmap which <see cref="HitObject"/> is a part of.
|
|
|
|
|
/// </summary>
|
2018-01-03 17:44:25 +08:00
|
|
|
|
protected readonly ManiaBeatmap Beatmap;
|
2017-05-18 14:05:45 +08:00
|
|
|
|
|
2018-01-03 17:44:25 +08:00
|
|
|
|
protected readonly int TotalColumns;
|
|
|
|
|
|
|
|
|
|
protected PatternGenerator(HitObject hitObject, ManiaBeatmap beatmap, Pattern previousPattern)
|
2017-05-18 14:05:45 +08:00
|
|
|
|
{
|
2017-08-22 15:46:12 +08: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));
|
|
|
|
|
|
2017-05-18 14:05:45 +08:00
|
|
|
|
HitObject = hitObject;
|
|
|
|
|
Beatmap = beatmap;
|
2017-08-22 15:22:40 +08:00
|
|
|
|
PreviousPattern = previousPattern;
|
2018-01-03 17:44:25 +08:00
|
|
|
|
|
|
|
|
|
TotalColumns = Beatmap.TotalColumns;
|
2017-05-18 14:05:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Generates the pattern for <see cref="HitObject"/>, filled with hit objects.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>The <see cref="Pattern"/> containing the hit objects.</returns>
|
|
|
|
|
public abstract Pattern Generate();
|
|
|
|
|
}
|
|
|
|
|
}
|