diff --git a/osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs b/osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs new file mode 100644 index 0000000000..8b4aee4f38 --- /dev/null +++ b/osu.Game/Rulesets/Mods/IApplicableToBeatmapConverter.cs @@ -0,0 +1,22 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Objects; + +namespace osu.Game.Rulesets.Mods +{ + /// + /// Interface for a that applies changes to a . + /// + /// The type of converted . + public interface IApplicableToBeatmapConverter + where TObject : HitObject + { + /// + /// Applies this to a . + /// + /// The to apply to. + void ApplyToBeatmapConverter(BeatmapConverter beatmapConverter); + } +} diff --git a/osu.Game/Rulesets/UI/RulesetContainer.cs b/osu.Game/Rulesets/UI/RulesetContainer.cs index 40a37c689b..0329725392 100644 --- a/osu.Game/Rulesets/UI/RulesetContainer.cs +++ b/osu.Game/Rulesets/UI/RulesetContainer.cs @@ -176,6 +176,10 @@ namespace osu.Game.Rulesets.UI if (!converter.CanConvert(workingBeatmap.Beatmap)) throw new BeatmapInvalidForRulesetException($"{nameof(Beatmap)} can not be converted for the current ruleset (converter: {converter})."); + // Apply conversion adjustments before converting + foreach (var mod in Mods.OfType>()) + mod.ApplyToBeatmapConverter(converter); + // Convert the beatmap Beatmap = converter.Convert(workingBeatmap.Beatmap); diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 519e214495..f87f664199 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -313,6 +313,7 @@ +