diff --git a/osu.Desktop.VisualTests/Tests/TestCaseReplay.cs b/osu.Desktop.VisualTests/Tests/TestCaseReplay.cs index b5a45f237a..c36fc0a47d 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseReplay.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseReplay.cs @@ -3,9 +3,7 @@ using osu.Framework.Input.Handlers; using osu.Game.Beatmaps; -using osu.Game.Modes; using osu.Game.Modes.Mods; -using osu.Game.Modes.Osu; using osu.Game.Modes.Osu.Mods; using osu.Game.Screens.Play; using System; diff --git a/osu.Game.Modes.Osu/Mods/IApplyableOsuMod.cs b/osu.Game.Modes.Osu/Mods/IApplyableOsuMod.cs deleted file mode 100644 index e30c2eb0a5..0000000000 --- a/osu.Game.Modes.Osu/Mods/IApplyableOsuMod.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Game.Modes.Mods; -using osu.Game.Modes.Osu.Objects; -using osu.Game.Modes.UI; - -namespace osu.Game.Modes.Osu.Mods -{ - internal interface IApplyableOsuMod : IApplyableMod> - { - } -} diff --git a/osu.Game.Modes.Osu/Mods/OsuMod.cs b/osu.Game.Modes.Osu/Mods/OsuMod.cs index f7d318a9d4..98b87a9bb5 100644 --- a/osu.Game.Modes.Osu/Mods/OsuMod.cs +++ b/osu.Game.Modes.Osu/Mods/OsuMod.cs @@ -88,7 +88,7 @@ namespace osu.Game.Modes.Osu.Mods public override Type[] IncompatibleMods => new[] { typeof(OsuModSpunOut), typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail), typeof(ModAutoplay) }; } - public class OsuModAutoplay : ModAutoplay, IApplyableOsuMod + public class OsuModAutoplay : ModAutoplay, IApplyableMod { public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(OsuModAutopilot) }).ToArray(); diff --git a/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj b/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj index 341accbdff..017d435983 100644 --- a/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj +++ b/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj @@ -44,7 +44,6 @@ - diff --git a/osu.Game/Modes/Mods/IApplyableMod.cs b/osu.Game/Modes/Mods/IApplyableMod.cs index 6e21aa1095..abbc3ea893 100644 --- a/osu.Game/Modes/Mods/IApplyableMod.cs +++ b/osu.Game/Modes/Mods/IApplyableMod.cs @@ -2,14 +2,28 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Modes.Objects; using osu.Game.Modes.UI; namespace osu.Game.Modes.Mods { - public interface IApplyableMod - where TRenderer : HitRenderer + /// + /// An interface for mods that are applied to a HitRenderer. + /// + /// The type of HitObject the HitRenderer contains. + public interface IApplyableMod + where TObject : HitObject { - void Apply(TRenderer hitRenderer); - void Revert(TRenderer hitRenderer); + /// + /// Applies the mod to a HitRenderer. + /// + /// The HitRenderer to apply the mod to. + void Apply(HitRenderer hitRenderer); + + /// + /// Reverts any changes applied to a HitRenderer through . + /// + /// The HitRenderer to revert from. + void Revert(HitRenderer hitRenderer); } } diff --git a/osu.Game/Modes/UI/HitRenderer.cs b/osu.Game/Modes/UI/HitRenderer.cs index 6bdcd15872..f124dd24ed 100644 --- a/osu.Game/Modes/UI/HitRenderer.cs +++ b/osu.Game/Modes/UI/HitRenderer.cs @@ -104,10 +104,9 @@ namespace osu.Game.Modes.UI foreach (var mod in mods) { - var applyable = mod as IApplyableMod>; + var applyable = mod as IApplyableMod; - if (applyable != null) - applyable.Apply(this); + applyable?.Apply(this); } }