Store hitobject history in the hitobject

This commit is contained in:
apollo-dw
2022-05-22 16:26:22 +01:00
parent d84119ac06
commit 26985ca8af
19 changed files with 94 additions and 88 deletions

View File

@ -49,6 +49,9 @@ namespace osu.Game.Rulesets.Catch.Difficulty
{
CatchHitObject lastObject = null;
List<DifficultyHitObject> objects = new List<DifficultyHitObject>();
int index = 0;
// In 2B beatmaps, it is possible that a normal Fruit is placed in the middle of a JuiceStream.
foreach (var hitObject in beatmap.HitObjects
.SelectMany(obj => obj is JuiceStream stream ? stream.NestedHitObjects.AsEnumerable() : new[] { obj })
@ -60,10 +63,15 @@ namespace osu.Game.Rulesets.Catch.Difficulty
continue;
if (lastObject != null)
yield return new CatchDifficultyHitObject(hitObject, lastObject, clockRate, halfCatcherWidth);
{
objects.Add(new CatchDifficultyHitObject(hitObject, lastObject, clockRate, halfCatcherWidth, objects, index));
index++;
}
lastObject = hitObject;
}
return objects;
}
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate)