1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-20 02:22:55 +08:00
osu-lazer/osu.Game/Rulesets/Mods/ModTimeAdjust.cs
2019-03-12 18:14:41 +09:00

25 lines
694 B
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;
using osu.Framework.Audio;
using osu.Framework.Timing;
namespace osu.Game.Rulesets.Mods
{
public abstract class ModTimeAdjust : Mod
{
public override Type[] IncompatibleMods => new[] { typeof(ModTimeRamp) };
protected abstract double RateAdjust { get; }
public virtual void ApplyToClock(IAdjustableClock clock)
{
if (clock is IHasTempoAdjust tempo)
tempo.TempoAdjust *= RateAdjust;
else
clock.Rate *= RateAdjust;
}
}
}