mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 11:42:54 +08:00
Slight refactoring
This commit is contained in:
parent
fd4c6e08ca
commit
d4a296f911
@ -98,12 +98,12 @@ namespace osu.Game.Rulesets.Mania.Replays
|
||||
|
||||
protected override HitObject GetNextObject(int currentIndex)
|
||||
{
|
||||
int desiredColumn = Beatmap.HitObjects[currentIndex++].Column;
|
||||
int desiredColumn = Beatmap.HitObjects[currentIndex].Column;
|
||||
|
||||
for (; currentIndex < Beatmap.HitObjects.Count; currentIndex++)
|
||||
for (int i = currentIndex + 1; i < Beatmap.HitObjects.Count; i++)
|
||||
{
|
||||
if (Beatmap.HitObjects[currentIndex].Column == desiredColumn)
|
||||
return Beatmap.HitObjects[currentIndex];
|
||||
if (Beatmap.HitObjects[i].Column == desiredColumn)
|
||||
return Beatmap.HitObjects[i];
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -137,14 +137,18 @@ namespace osu.Game.Rulesets.Taiko.Replays
|
||||
|
||||
protected override HitObject GetNextObject(int currentIndex)
|
||||
{
|
||||
Type desiredType = Beatmap.HitObjects[currentIndex++].GetType();
|
||||
Type desiredType = Beatmap.HitObjects[currentIndex].GetType();
|
||||
|
||||
for (; currentIndex < Beatmap.HitObjects.Count; currentIndex++)
|
||||
for (int i = currentIndex + 1; i < Beatmap.HitObjects.Count; i++)
|
||||
{
|
||||
var currentObj = Beatmap.HitObjects[currentIndex];
|
||||
var currentObj = Beatmap.HitObjects[i];
|
||||
|
||||
if (currentObj.GetType() == desiredType ||
|
||||
currentObj is DrumRoll || currentObj is Swell) // Unpress all keys before DrumRoll or Swell
|
||||
return Beatmap.HitObjects[currentIndex];
|
||||
// Un-press all keys before a DrumRoll or Swell
|
||||
currentObj is DrumRoll || currentObj is Swell)
|
||||
{
|
||||
return Beatmap.HitObjects[i];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user