1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 14:17:26 +08:00

Remove generics from IApplicableToTrack

This commit is contained in:
smoogipoo 2020-08-06 18:25:34 +09:00
parent c8ebbc8594
commit 7c3ae4ed42
5 changed files with 11 additions and 13 deletions

View File

@ -1,7 +1,6 @@
// 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 osu.Framework.Audio;
using osu.Framework.Audio.Track;
namespace osu.Game.Rulesets.Mods
@ -11,6 +10,6 @@ namespace osu.Game.Rulesets.Mods
/// </summary>
public interface IApplicableToTrack : IApplicableMod
{
void ApplyToTrack<T>(T track) where T : class, ITrack, IAdjustableAudioComponent;
void ApplyToTrack(ITrack track);
}
}

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Audio;
using osu.Framework.Audio.Track;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Sprites;
@ -26,11 +27,11 @@ namespace osu.Game.Rulesets.Mods
}, true);
}
public override void ApplyToTrack<T>(T track)
public override void ApplyToTrack(ITrack track)
{
// base.ApplyToTrack() intentionally not called (different tempo adjustment is applied)
track.AddAdjustment(AdjustableProperty.Frequency, freqAdjust);
track.AddAdjustment(AdjustableProperty.Tempo, tempoAdjust);
(track as IAdjustableAudioComponent)?.AddAdjustment(AdjustableProperty.Frequency, freqAdjust);
(track as IAdjustableAudioComponent)?.AddAdjustment(AdjustableProperty.Tempo, tempoAdjust);
}
}
}

View File

@ -38,11 +38,11 @@ namespace osu.Game.Rulesets.Mods
}, true);
}
public override void ApplyToTrack<T>(T track)
public override void ApplyToTrack(ITrack track)
{
// base.ApplyToTrack() intentionally not called (different tempo adjustment is applied)
track.AddAdjustment(AdjustableProperty.Frequency, freqAdjust);
track.AddAdjustment(AdjustableProperty.Tempo, tempoAdjust);
(track as IAdjustableAudioComponent)?.AddAdjustment(AdjustableProperty.Frequency, freqAdjust);
(track as IAdjustableAudioComponent)?.AddAdjustment(AdjustableProperty.Tempo, tempoAdjust);
}
public void ApplyToDrawableRuleset(DrawableRuleset<TObject> drawableRuleset)

View File

@ -12,10 +12,9 @@ namespace osu.Game.Rulesets.Mods
{
public abstract BindableNumber<double> SpeedChange { get; }
public virtual void ApplyToTrack<T>(T track)
where T : class, ITrack, IAdjustableAudioComponent
public virtual void ApplyToTrack(ITrack track)
{
track.AddAdjustment(AdjustableProperty.Tempo, SpeedChange);
(track as IAdjustableAudioComponent)?.AddAdjustment(AdjustableProperty.Tempo, SpeedChange);
}
public virtual void ApplyToSample(SampleChannel sample)

View File

@ -51,8 +51,7 @@ namespace osu.Game.Rulesets.Mods
AdjustPitch.BindValueChanged(applyPitchAdjustment);
}
public void ApplyToTrack<T>(T track)
where T : class, ITrack, IAdjustableAudioComponent
public void ApplyToTrack(ITrack track)
{
this.track = track;