1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 16:22:57 +08:00
osu-lazer/osu.Game/Rulesets/Mods/ModTimeAdjust.cs

25 lines
694 B
C#
Raw Normal View History

2019-03-12 17:14:41 +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.
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;
}
}
}