1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Refactoring

This commit is contained in:
Desconocidosmh 2019-08-19 20:45:23 +02:00
parent 9bd844bf4d
commit 77e9e89fec
2 changed files with 6 additions and 6 deletions

View File

@ -81,14 +81,14 @@ namespace osu.Game.Rulesets.Mania.Replays
for (int i = 0; i < Beatmap.HitObjects.Count; i++)
{
var currentObject = Beatmap.HitObjects[i];
var nextObjectInTheSameColumn = GetNextObject(i);
var nextObjectInColumn = GetNextObject(i); // Get the next object that requires pressing the same button
double endTime = (currentObject as IHasEndTime)?.EndTime ?? currentObject.StartTime;
bool canDelayKeyUp = nextObjectInTheSameColumn == null ||
nextObjectInTheSameColumn.StartTime > endTime + RELEASE_DELAY;
bool canDelayKeyUp = nextObjectInColumn == null ||
nextObjectInColumn.StartTime > endTime + RELEASE_DELAY;
double calculatedDelay = canDelayKeyUp ? RELEASE_DELAY : (nextObjectInTheSameColumn.StartTime - endTime) * 0.9;
double calculatedDelay = canDelayKeyUp ? RELEASE_DELAY : (nextObjectInColumn.StartTime - endTime) * 0.9;
yield return new HitPoint { Time = currentObject.StartTime, Column = currentObject.Column };

View File

@ -114,7 +114,7 @@ namespace osu.Game.Rulesets.Taiko.Replays
else
throw new InvalidOperationException("Unknown hit object type.");
var nextHitObject = GetNextObject(i);
var nextHitObject = GetNextObject(i); // Get the next object that requires pressing the same button
bool canDelayKeyUp = nextHitObject == null || nextHitObject.StartTime > endTime + KEY_UP_DELAY;
@ -142,7 +142,7 @@ namespace osu.Game.Rulesets.Taiko.Replays
for (; currentIndex < Beatmap.HitObjects.Count; currentIndex++)
{
var currentObj = Beatmap.HitObjects[currentIndex];
if (currentObj.GetType().Equals(desiredType) ||
if (currentObj.GetType() == desiredType ||
currentObj is DrumRoll || currentObj is Swell) // Unpress all keys before DrumRoll or Swell
return Beatmap.HitObjects[currentIndex];
}