mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
37 lines
1.0 KiB
C#
37 lines
1.0 KiB
C#
using osu.Game.Beatmaps;
|
|
using osu.Game.Rulesets.Beatmaps;
|
|
using osu.Game.Rulesets.Catch.Objects;
|
|
|
|
namespace osu.Game.Rulesets.Catch.Beatmaps
|
|
{
|
|
internal class CatchBeatmapProcessor : BeatmapProcessor<CatchBaseHit>
|
|
{
|
|
public override void PostProcess(Beatmap<CatchBaseHit> beatmap)
|
|
{
|
|
if (beatmap.ComboColors.Count == 0)
|
|
return;
|
|
|
|
int comboIndex = 0;
|
|
int colourIndex = 0;
|
|
|
|
CatchBaseHit lastObj = null;
|
|
|
|
foreach (var obj in beatmap.HitObjects)
|
|
{
|
|
if (obj.NewCombo)
|
|
{
|
|
if (lastObj != null) lastObj.LastInCombo = true;
|
|
|
|
comboIndex = 0;
|
|
colourIndex = (colourIndex + 1) % beatmap.ComboColors.Count;
|
|
}
|
|
|
|
obj.ComboIndex = comboIndex++;
|
|
obj.ComboColour = beatmap.ComboColors[colourIndex];
|
|
|
|
lastObj = obj;
|
|
}
|
|
}
|
|
}
|
|
}
|