Remove siblings.

This commit is contained in:
smoogipooo
2017-05-22 09:50:36 +09:00
parent 384295bdca
commit 3041b55aac

View File

@ -143,7 +143,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
{ {
while (pattern.IsFilled(nextColumn) || PreviousPattern.IsFilled(nextColumn)) //find available column while (pattern.IsFilled(nextColumn) || PreviousPattern.IsFilled(nextColumn)) //find available column
nextColumn = Random.Next(RandomStart, AvailableColumns); nextColumn = Random.Next(RandomStart, AvailableColumns);
addToPattern(pattern, nextColumn, startTime, endTime, noteCount); addToPattern(pattern, nextColumn, startTime, endTime);
} }
// This is can't be combined with the above loop due to RNG // This is can't be combined with the above loop due to RNG
@ -151,7 +151,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
{ {
while (pattern.IsFilled(nextColumn)) while (pattern.IsFilled(nextColumn))
nextColumn = Random.Next(RandomStart, AvailableColumns); nextColumn = Random.Next(RandomStart, AvailableColumns);
addToPattern(pattern, nextColumn, startTime, endTime, noteCount); addToPattern(pattern, nextColumn, startTime, endTime);
} }
return pattern; return pattern;
@ -267,7 +267,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
int nextColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true); int nextColumn = GetColumn((HitObject as IHasXPosition)?.X ?? 0, true);
for (int i = 0; i <= repeatCount; i++) for (int i = 0; i <= repeatCount; i++)
{ {
addToPattern(pattern, nextColumn, startTime, startTime, 2); addToPattern(pattern, nextColumn, startTime, startTime);
nextColumn += interval; nextColumn += interval;
if (nextColumn >= AvailableColumns - RandomStart) if (nextColumn >= AvailableColumns - RandomStart)
@ -276,7 +276,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
// If we're in 2K, let's not add many consecutive doubles // If we're in 2K, let's not add many consecutive doubles
if (AvailableColumns > 2) if (AvailableColumns > 2)
addToPattern(pattern, nextColumn, startTime, startTime, 2); addToPattern(pattern, nextColumn, startTime, startTime);
nextColumn = Random.Next(RandomStart, AvailableColumns); nextColumn = Random.Next(RandomStart, AvailableColumns);
startTime += segmentDuration; startTime += segmentDuration;
@ -367,7 +367,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
while (pattern.IsFilled(nextColumn)) while (pattern.IsFilled(nextColumn))
nextColumn = Random.Next(RandomStart, AvailableColumns); nextColumn = Random.Next(RandomStart, AvailableColumns);
addToPattern(pattern, nextColumn, startTime, endTime, repeatCount); addToPattern(pattern, nextColumn, startTime, endTime);
startTime += segmentDuration; startTime += segmentDuration;
} }
@ -420,7 +420,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
{ {
while (rowPattern.IsFilled(nextColumn) || nextColumn == holdColumn) while (rowPattern.IsFilled(nextColumn) || nextColumn == holdColumn)
nextColumn = Random.Next(RandomStart, AvailableColumns); nextColumn = Random.Next(RandomStart, AvailableColumns);
addToPattern(rowPattern, nextColumn, startTime, startTime, noteCount + 1); addToPattern(rowPattern, nextColumn, startTime, startTime);
} }
} }
@ -459,8 +459,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
/// <param name="column">The column to add the note to.</param> /// <param name="column">The column to add the note to.</param>
/// <param name="startTime">The start time of the note.</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="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> private void addToPattern(Pattern pattern, int column, double startTime, double endTime)
private void addToPattern(Pattern pattern, int column, double startTime, double endTime, int siblings = 1)
{ {
ManiaHitObject newObject; ManiaHitObject newObject;
@ -470,8 +469,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
{ {
StartTime = startTime, StartTime = startTime,
Samples = sampleInfoListAt(startTime), Samples = sampleInfoListAt(startTime),
Column = column, Column = column
Siblings = siblings
}; };
} }
else else
@ -482,8 +480,7 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
Samples = sampleInfoListAt(startTime), Samples = sampleInfoListAt(startTime),
EndSamples = sampleInfoListAt(endTime), EndSamples = sampleInfoListAt(endTime),
Column = column, Column = column,
Duration = endTime - startTime, Duration = endTime - startTime
Siblings = siblings
}; };
} }