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