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

Merge pull request #13884 from peppy/remove-read-from-difficulty

Remove `IApplicableToDifficulty.ReadFromDifficulty`
This commit is contained in:
Dan Balasescu 2021-07-14 13:10:34 +09:00 committed by GitHub
commit 4b4c341fb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 25 deletions

View File

@ -525,16 +525,11 @@ namespace osu.Game
private void beatmapChanged(ValueChangedEvent<WorkingBeatmap> beatmap)
{
beatmap.OldValue?.CancelAsyncLoad();
updateModDefaults();
beatmap.NewValue?.BeginAsyncLoad();
}
private void modsChanged(ValueChangedEvent<IReadOnlyList<Mod>> mods)
{
updateModDefaults();
// a lease may be taken on the mods bindable, at which point we can't really ensure valid mods.
if (SelectedMods.Disabled)
return;
@ -546,19 +541,6 @@ namespace osu.Game
}
}
private void updateModDefaults()
{
BeatmapDifficulty baseDifficulty = Beatmap.Value.BeatmapInfo.BaseDifficulty;
if (baseDifficulty != null && SelectedMods.Value.Any(m => m is IApplicableToDifficulty))
{
var adjustedDifficulty = baseDifficulty.Clone();
foreach (var mod in SelectedMods.Value.OfType<IApplicableToDifficulty>())
mod.ReadFromDifficulty(adjustedDifficulty);
}
}
#endregion
private PerformFromMenuRunner performFromMainMenuTask;

View File

@ -10,13 +10,6 @@ namespace osu.Game.Rulesets.Mods
/// </summary>
public interface IApplicableToDifficulty : IApplicableMod
{
/// <summary>
/// Called when a beatmap is changed. Can be used to read default values.
/// Any changes made will not be preserved.
/// </summary>
/// <param name="difficulty">The difficulty to read from.</param>
void ReadFromDifficulty(BeatmapDifficulty difficulty);
/// <summary>
/// Called post beatmap conversion. Can be used to apply changes to difficulty attributes.
/// </summary>