1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 13:15:08 +08:00

De-nest cheese detection logic

This commit is contained in:
Bartłomiej Dach 2020-08-18 19:18:36 +02:00
parent 6c759f31f1
commit 292d38362c

View File

@ -38,33 +38,34 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
if (!history.Full)
continue;
bool isRepeat = true;
for (int j = 0; j < patternLength; j++)
{
if (history[j].HitType != history[j + patternLength].HitType)
{
isRepeat = false;
}
}
if (!isRepeat)
if (!containsPatternRepeat(history, patternLength))
{
repetitionStart = i - 2 * patternLength;
continue;
}
int repeatedLength = i - repetitionStart;
if (repeatedLength < roll_min_repetitions)
continue;
if (repeatedLength >= roll_min_repetitions)
for (int j = repetitionStart; j < i; j++)
{
for (int j = repetitionStart; j < i; j++)
{
hitObjects[j].StaminaCheese = true;
}
hitObjects[j].StaminaCheese = true;
}
}
}
private static bool containsPatternRepeat(LimitedCapacityQueue<TaikoDifficultyHitObject> history, int patternLength)
{
for (int j = 0; j < patternLength; j++)
{
if (history[j].HitType != history[j + patternLength].HitType)
return false;
}
return true;
}
private void findTlTap(int parity, HitType type)
{
int tlLength = -2;
@ -72,20 +73,16 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
for (int i = parity; i < hitObjects.Count; i += 2)
{
if (hitObjects[i].HitType == type)
{
tlLength += 2;
}
else
{
tlLength = -2;
}
if (tlLength >= tl_min_repetitions)
if (tlLength < tl_min_repetitions)
continue;
for (int j = Math.Max(0, i - tlLength); j < i; j++)
{
for (int j = Math.Max(0, i - tlLength); j < i; j++)
{
hitObjects[j].StaminaCheese = true;
}
hitObjects[j].StaminaCheese = true;
}
}
}