From 1cb3c710ba316a8d6642f25b9a4472fc37c75a8d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 6 Dec 2023 14:30:35 +0900 Subject: [PATCH] Remove complex implementation of taiko SV multiplier --- .../Editor/TestSceneTaikoEditorSaving.cs | 7 +-- .../Beatmaps/TaikoBeatmapConverter.cs | 43 ------------------- 2 files changed, 1 insertion(+), 49 deletions(-) diff --git a/osu.Game.Rulesets.Taiko.Tests/Editor/TestSceneTaikoEditorSaving.cs b/osu.Game.Rulesets.Taiko.Tests/Editor/TestSceneTaikoEditorSaving.cs index af7db2251b..1d5efb01e4 100644 --- a/osu.Game.Rulesets.Taiko.Tests/Editor/TestSceneTaikoEditorSaving.cs +++ b/osu.Game.Rulesets.Taiko.Tests/Editor/TestSceneTaikoEditorSaving.cs @@ -3,7 +3,6 @@ using NUnit.Framework; using osu.Framework.Utils; -using osu.Game.Rulesets.Taiko.Beatmaps; using osu.Game.Tests.Visual; namespace osu.Game.Rulesets.Taiko.Tests.Editor @@ -27,11 +26,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Editor bool assertTaikoSliderMulitplier() { - // we can only assert value correctness on TaikoMultiplierAppliedDifficulty, because that is the final difficulty converted taiko beatmaps use. - // therefore, ensure that we have that difficulty type by calling .CopyFrom(), which is a no-op if the type is already correct. - var taikoDifficulty = new TaikoBeatmapConverter.TaikoMultiplierAppliedDifficulty(); - taikoDifficulty.CopyFrom(EditorBeatmap.Difficulty); - return Precision.AlmostEquals(taikoDifficulty.SliderMultiplier, 2); + return Precision.AlmostEquals(EditorBeatmap.Difficulty.SliderMultiplier, 2); } } } diff --git a/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs index b9d65d2631..5229d3ff23 100644 --- a/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -10,7 +10,6 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.Utils; using System.Threading; -using JetBrains.Annotations; using osu.Game.Audio; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps.Formats; @@ -43,12 +42,6 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps protected override Beatmap ConvertBeatmap(IBeatmap original, CancellationToken cancellationToken) { - if (!(original.Difficulty is TaikoMultiplierAppliedDifficulty)) - { - // Rewrite the beatmap info to add the slider velocity multiplier - original.Difficulty = new TaikoMultiplierAppliedDifficulty(original.Difficulty); - } - Beatmap converted = base.ConvertBeatmap(original, cancellationToken); if (original.BeatmapInfo.Ruleset.OnlineID == 0) @@ -218,41 +211,5 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps } protected override Beatmap CreateBeatmap() => new TaikoBeatmap(); - - // Important to note that this is subclassing a realm object. - // Realm doesn't allow this, but for now this can work since we aren't (in theory?) persisting this to the database. - // It is only used during beatmap conversion and processing. - internal class TaikoMultiplierAppliedDifficulty : BeatmapDifficulty - { - public TaikoMultiplierAppliedDifficulty(IBeatmapDifficultyInfo difficulty) - { - CopyFrom(difficulty); - } - - [UsedImplicitly] - public TaikoMultiplierAppliedDifficulty() - { - } - - #region Overrides of BeatmapDifficulty - - public override BeatmapDifficulty Clone() => new TaikoMultiplierAppliedDifficulty(this); - - public override void CopyTo(BeatmapDifficulty other) - { - base.CopyTo(other); - if (!(other is TaikoMultiplierAppliedDifficulty)) - other.SliderMultiplier /= LegacyBeatmapEncoder.LEGACY_TAIKO_VELOCITY_MULTIPLIER; - } - - public override void CopyFrom(IBeatmapDifficultyInfo other) - { - base.CopyFrom(other); - if (!(other is TaikoMultiplierAppliedDifficulty)) - SliderMultiplier *= LegacyBeatmapEncoder.LEGACY_TAIKO_VELOCITY_MULTIPLIER; - } - - #endregion - } } }