2021-04-14 15:52:29 +08: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.
|
|
|
|
|
2021-04-20 17:36:11 +08:00
|
|
|
using System.Collections.Generic;
|
2021-04-14 15:52:29 +08:00
|
|
|
using osu.Game.Rulesets.Mods;
|
2021-04-20 17:36:11 +08:00
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2021-04-15 12:06:52 +08:00
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
2021-04-20 17:36:11 +08:00
|
|
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
2021-04-14 15:52:29 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Mods
|
|
|
|
{
|
2021-04-30 06:59:59 +08:00
|
|
|
public class OsuModBarrelRoll : ModBarrelRoll<OsuHitObject>, IApplicableToDrawableHitObjects
|
2021-04-14 15:52:29 +08:00
|
|
|
{
|
2021-04-20 17:36:11 +08:00
|
|
|
public void ApplyToDrawableHitObjects(IEnumerable<DrawableHitObject> drawables)
|
|
|
|
{
|
|
|
|
foreach (var d in drawables)
|
|
|
|
{
|
|
|
|
d.OnUpdate += _ =>
|
|
|
|
{
|
|
|
|
switch (d)
|
|
|
|
{
|
|
|
|
case DrawableHitCircle circle:
|
2021-04-30 06:59:59 +08:00
|
|
|
circle.CirclePiece.Rotation = -CurrentRotation;
|
2021-04-20 17:36:11 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
2021-04-14 15:52:29 +08:00
|
|
|
}
|
|
|
|
}
|