Resolve errors + auto-format

This commit is contained in:
smoogipoo
2020-05-11 14:53:42 +09:00
parent d613888803
commit 779af48802
6 changed files with 25 additions and 37 deletions

View File

@ -1,15 +1,12 @@
// 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.
using System;
using System.Collections.Generic;
using osu.Game.Rulesets.Difficulty.Preprocessing;
namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
{
public class StaminaCheeseDetector
{
private const int roll_min_repetitions = 12;
private const int tl_min_repetitions = 16;
@ -39,6 +36,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
if (history.Count > 2 * patternLength) history.RemoveAt(0);
bool isRepeat = true;
for (int j = 0; j < patternLength; j++)
{
if (history[j].IsKat != history[j + patternLength].IsKat)
@ -62,13 +60,13 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
(hitObjects[i]).StaminaCheese = true;
}
}
}
}
private void findTLTap(int parity, bool kat)
{
int tl_length = -2;
for (int i = parity; i < hitObjects.Count; i += 2)
{
if (kat == hitObjects[i].IsKat)
@ -90,6 +88,5 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
}
}
}
}
}

View File

@ -1,7 +1,6 @@
// 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.
using System;
using osu.Game.Rulesets.Difficulty.Preprocessing;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Taiko.Objects;
@ -27,12 +26,15 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
public TaikoDifficultyHitObject(HitObject hitObject, HitObject lastObject, HitObject lastLastObject, double clockRate)
: base(hitObject, lastObject, clockRate)
{
var lastHit = lastObject as Hit;
var currentHit = hitObject as Hit;
NoteLength = DeltaTime;
double prevLength = (lastObject.StartTime - lastLastObject.StartTime) / clockRate;
Rhythm = TaikoDifficultyHitObjectRhythm.GetClosest(NoteLength / prevLength);
RhythmID = Rhythm.ID;
HasTypeChange = lastObject is RimHit != hitObject is RimHit;
IsKat = lastObject is RimHit;
HasTypeChange = lastHit?.Type != currentHit?.Type;
IsKat = lastHit?.Type == HitType.Rim;
HasTimingChange = !TaikoDifficultyHitObjectRhythm.IsRepeat(RhythmID);
n = counter;
@ -40,7 +42,5 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing
}
public const int CONST_RHYTHM_ID = 0;
}
}