mirror of
https://github.com/ppy/osu
synced 2024-12-12 18:07:52 +00:00
e69bb67afe
Less cumbersome to implement than old version taking an enumerable. The implementation was always using `foreach` for the enumerable. The new interface is not used yet.
29 lines
1.2 KiB
C#
29 lines
1.2 KiB
C#
// 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 System.Collections.Generic;
|
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
|
|
|
namespace osu.Game.Rulesets.Mods
|
|
{
|
|
/// <summary>
|
|
/// An interface for <see cref="Mod"/>s that can be applied to <see cref="DrawableHitObject"/>s.
|
|
/// </summary>
|
|
public interface IApplicableToDrawableHitObject : IApplicableMod
|
|
{
|
|
/// <summary>
|
|
/// Applies this <see cref="IApplicableToDrawableHitObject"/> to a <see cref="DrawableHitObject"/>.
|
|
/// This will only be invoked with top-level <see cref="DrawableHitObject"/>s. Access <see cref="DrawableHitObject.NestedHitObjects"/> if adjusting nested objects is necessary.
|
|
/// </summary>
|
|
void ApplyToDrawableHitObject(DrawableHitObject drawable);
|
|
}
|
|
|
|
public interface IApplicableToDrawableHitObjects : IApplicableToDrawableHitObject
|
|
{
|
|
void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables);
|
|
|
|
void IApplicableToDrawableHitObject.ApplyToDrawableHitObject(DrawableHitObject drawable) => ApplyToDrawableHitObjects(drawable.Yield());
|
|
}
|
|
}
|