osu/osu.Game/Beatmaps/BeatmapProcessor.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.1 KiB
C#
Raw Normal View History

// 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.
2018-04-13 09:19:50 +00:00
using System.Linq;
using osu.Game.Rulesets.Objects.Types;
2018-04-13 09:19:50 +00:00
2017-09-18 13:32:49 +00:00
namespace osu.Game.Beatmaps
{
/// <summary>
/// Provides functionality to alter a <see cref="IBeatmap"/> after it has been converted.
/// </summary>
public class BeatmapProcessor : IBeatmapProcessor
{
public IBeatmap Beatmap { get; }
public BeatmapProcessor(IBeatmap beatmap)
{
Beatmap = beatmap;
}
public virtual void PreProcess()
{
IHasComboInformation? lastObj = null;
foreach (var obj in Beatmap.HitObjects.OfType<IHasComboInformation>())
{
if (lastObj == null)
{
// first hitobject should always be marked as a new combo for sanity.
obj.NewCombo = true;
}
2018-04-13 09:19:50 +00:00
obj.UpdateComboInformation(lastObj);
lastObj = obj;
}
}
public virtual void PostProcess()
{
}
}
}