Merge pull request #14980 from peppy/difficulty-move-to-beatmap

Copy `BaseDifficulty` to `Beatmap<T>` and move the majority of write operations across
This commit is contained in:
Dan Balasescu
2021-10-07 18:43:44 +09:00
committed by GitHub
50 changed files with 202 additions and 129 deletions

View File

@ -182,7 +182,7 @@ namespace osu.Game.Tests.Visual.Gameplay
{
var beatmap = createBeatmap();
beatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = time_range });
beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier = 2;
beatmap.Difficulty.SliderMultiplier = 2;
createTest(beatmap, d => d.RelativeScaleBeatLengthsOverride = true);
AddStep("adjust time range", () => drawableRuleset.TimeRange.Value = 5000);
@ -196,7 +196,7 @@ namespace osu.Game.Tests.Visual.Gameplay
{
var beatmap = createBeatmap();
beatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = time_range });
beatmap.BeatmapInfo.BaseDifficulty.SliderMultiplier = 2;
beatmap.Difficulty.SliderMultiplier = 2;
createTest(beatmap);
AddStep("adjust time range", () => drawableRuleset.TimeRange.Value = 2000);

View File

@ -55,7 +55,7 @@ namespace osu.Game.Tests.Visual.Gameplay
{
var beatmap = new Beatmap
{
BeatmapInfo = { BaseDifficulty = { ApproachRate = 9 } },
Difficulty = { ApproachRate = 9 },
};
for (int i = 0; i < 15; i++)

View File

@ -137,11 +137,11 @@ namespace osu.Game.Tests.Visual.Playlists
InputManager.Click(MouseButton.Left);
});
AddAssert("match has altered beatmap", () => match.Beatmap.Value.Beatmap.BeatmapInfo.BaseDifficulty.CircleSize == 1);
AddAssert("match has altered beatmap", () => match.Beatmap.Value.Beatmap.Difficulty.CircleSize == 1);
AddStep("re-import original beatmap", () => manager.Import(new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo.BeatmapSet).Wait());
AddAssert("match has original beatmap", () => match.Beatmap.Value.Beatmap.BeatmapInfo.BaseDifficulty.CircleSize != 1);
AddAssert("match has original beatmap", () => match.Beatmap.Value.Beatmap.Difficulty.CircleSize != 1);
}
private class TestPlaylistsRoomSubScreen : PlaylistsRoomSubScreen