mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 16:12:54 +08:00
This function can't be used for all pattern generations. So let's not use it.
This commit is contained in:
parent
af34777f44
commit
873ff34487
@ -47,43 +47,5 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>The <see cref="Pattern"/> containing the hit objects.</returns>
|
/// <returns>The <see cref="Pattern"/> containing the hit objects.</returns>
|
||||||
public abstract Pattern Generate();
|
public abstract Pattern Generate();
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructs and adds a note to a pattern.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pattern">The pattern to add to.</param>
|
|
||||||
/// <param name="originalObject">The original hit object (used for samples).</param>
|
|
||||||
/// <param name="column">The column to add the note to.</param>
|
|
||||||
/// <param name="startTime">The start time of the note.</param>
|
|
||||||
/// <param name="endTime">The end time of the note (set to <paramref name="startTime"/> for a non-hold note).</param>
|
|
||||||
/// <param name="siblings">The number of children alongside this note (these will not be generated, but are used for volume calculations).</param>
|
|
||||||
protected void AddToPattern(Pattern pattern, HitObject originalObject, int column, double startTime, double endTime, int siblings = 1)
|
|
||||||
{
|
|
||||||
ManiaHitObject newObject;
|
|
||||||
|
|
||||||
if (startTime == endTime)
|
|
||||||
{
|
|
||||||
newObject = new Note
|
|
||||||
{
|
|
||||||
StartTime = startTime,
|
|
||||||
Samples = originalObject.Samples,
|
|
||||||
Column = column
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
newObject = new HoldNote
|
|
||||||
{
|
|
||||||
StartTime = startTime,
|
|
||||||
Samples = originalObject.Samples,
|
|
||||||
Column = column,
|
|
||||||
Duration = endTime - startTime
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Todo: Consider siblings and write sample volumes (probably at ManiaHitObject level)
|
|
||||||
|
|
||||||
pattern.Add(newObject);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user