osu/osu.Game.Rulesets.Osu/Mods/OsuModBarrelRoll.cs

31 lines
982 B
C#
Raw Normal View History

2021-04-14 07:52:29 +00:00
// 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;
2021-04-14 07:52:29 +00:00
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
2021-04-14 07:52:29 +00:00
namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModBarrelRoll : ModBarrelRoll<OsuHitObject>, IApplicableToDrawableHitObjects
2021-04-14 07:52:29 +00:00
{
public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
{
foreach (var d in drawables)
{
d.OnUpdate += _ =>
{
switch (d)
{
case DrawableHitCircle circle:
circle.CirclePiece.Rotation = -CurrentRotation;
break;
}
};
}
}
2021-04-14 07:52:29 +00:00
}
}