1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 01:52:55 +08:00

Pass empty facade and replace random property with method instead

This commit is contained in:
Salman Ahmed 2021-05-08 18:43:45 +03:00
parent a75347cb2a
commit ca55287dd0

View File

@ -23,15 +23,9 @@ namespace osu.Game.Tests.Visual.SongSelect
[Resolved] [Resolved]
private BeatmapManager manager { get; set; } private BeatmapManager manager { get; set; }
private IReadOnlyList<Mod> randomMods => Ruleset.Value.CreateInstance()
.GetAllMods()
.OrderBy(_ => RNG.Next())
.Take(5)
.ToList();
private void createDisplay(Func<WorkingBeatmap> getBeatmap) private void createDisplay(Func<WorkingBeatmap> getBeatmap)
{ {
AddStep("setup display", () => Child = display = new BeatmapMetadataDisplay(getBeatmap(), new Bindable<IReadOnlyList<Mod>>(randomMods), null) AddStep("setup display", () => Child = display = new BeatmapMetadataDisplay(getBeatmap(), new Bindable<IReadOnlyList<Mod>>(getRandomMods()), Empty())
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
@ -76,5 +70,11 @@ namespace osu.Game.Tests.Visual.SongSelect
return manager.GetWorkingBeatmap(randomBeatmap); return manager.GetWorkingBeatmap(randomBeatmap);
}); });
} }
private IReadOnlyList<Mod> getRandomMods() => Ruleset.Value.CreateInstance()
.GetAllMods()
.OrderBy(_ => RNG.Next())
.Take(5)
.ToList();
} }
} }