1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 18:32:56 +08:00

Use test beatmap instead of beatmap manager

This commit is contained in:
smoogipoo 2020-02-14 17:59:14 +09:00
parent 5ec9f454d5
commit de646649de

View File

@ -1,37 +1,25 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Utils;
using osu.Game.Beatmaps;
using osu.Game.Online.Multiplayer;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Screens.Multi.Components;
using osu.Game.Tests.Beatmaps;
using osuTK;
namespace osu.Game.Tests.Visual.Multiplayer
{
public class TestSceneMatchBeatmapDetailArea : MultiplayerTestScene
{
[Resolved]
private BeatmapManager beatmapManager { get; set; }
[Resolved]
private RulesetStore rulesetStore { get; set; }
private MatchBeatmapDetailArea detailArea;
[SetUp]
public void Setup() => Schedule(() =>
{
Room.Playlist.Clear();
Child = detailArea = new MatchBeatmapDetailArea
Child = new MatchBeatmapDetailArea
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
@ -42,19 +30,11 @@ namespace osu.Game.Tests.Visual.Multiplayer
private void createNewItem()
{
var set = beatmapManager.GetAllUsableBeatmapSetsEnumerable().First();
var rulesets = rulesetStore.AvailableRulesets.ToList();
var beatmap = set.Beatmaps[RNG.Next(0, set.Beatmaps.Count)];
beatmap.BeatmapSet = set;
beatmap.Metadata = set.Metadata;
Room.Playlist.Add(new PlaylistItem
{
ID = Room.Playlist.Count,
Beatmap = { Value = beatmap },
Ruleset = { Value = rulesets[RNG.Next(0, rulesets.Count)] },
Beatmap = { Value = new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo },
Ruleset = { Value = new OsuRuleset().RulesetInfo },
RequiredMods =
{
new OsuModHardRock(),