1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-16 00:22:58 +08:00

Add IApplicableToBeatmapProcessor mod interface

This commit is contained in:
ekrctb 2021-06-23 14:08:24 +09:00
parent a1da9c5ee3
commit e1b2c63e09
2 changed files with 21 additions and 0 deletions

View File

@ -133,6 +133,9 @@ namespace osu.Game.Beatmaps
IBeatmapProcessor processor = rulesetInstance.CreateBeatmapProcessor(converted); IBeatmapProcessor processor = rulesetInstance.CreateBeatmapProcessor(converted);
foreach (var mod in mods.OfType<IApplicableToBeatmapProcessor>())
mod.ApplyToBeatmapProcessor(processor);
processor?.PreProcess(); processor?.PreProcess();
// Compute default values for hitobjects, including creating nested hitobjects in-case they're needed // Compute default values for hitobjects, including creating nested hitobjects in-case they're needed

View File

@ -0,0 +1,18 @@
// 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.
using osu.Game.Beatmaps;
namespace osu.Game.Rulesets.Mods
{
/// <summary>
/// Interface for a <see cref="Mod"/> that applies changes to a <see cref="BeatmapProcessor"/>.
/// </summary>
public interface IApplicableToBeatmapProcessor : IApplicableMod
{
/// <summary>
/// Applies this <see cref="Mod"/> to a <see cref="BeatmapProcessor"/>.
/// </summary>
void ApplyToBeatmapProcessor(IBeatmapProcessor beatmapProcessor);
}
}