1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00
osu-lazer/osu.Game.Tests/Visual/Multiplayer/TestSceneMatchBeatmapDetailArea.cs
2024-11-21 20:32:09 +09:00

53 lines
1.7 KiB
C#

// 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 osu.Framework.Graphics;
using osu.Game.Online.API;
using osu.Game.Online.Rooms;
using osu.Game.Rulesets.Osu;
using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Screens.OnlinePlay.Components;
using osu.Game.Tests.Beatmaps;
using osu.Game.Tests.Visual.OnlinePlay;
using osuTK;
namespace osu.Game.Tests.Visual.Multiplayer
{
public partial class TestSceneMatchBeatmapDetailArea : OnlinePlayTestScene
{
public override void SetUpSteps()
{
base.SetUpSteps();
AddStep("create area", () =>
{
SelectedRoom.Value = new Room();
Child = new MatchBeatmapDetailArea(SelectedRoom.Value)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(500),
CreateNewItem = createNewItem
};
});
}
private void createNewItem()
{
SelectedRoom.Value!.Playlist = SelectedRoom.Value.Playlist.Append(new PlaylistItem(new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo)
{
ID = SelectedRoom.Value.Playlist.Count,
RulesetID = new OsuRuleset().RulesetInfo.OnlineID,
RequiredMods = new[]
{
new APIMod(new OsuModHardRock()),
new APIMod(new OsuModDoubleTime()),
new APIMod(new OsuModAutoplay())
}
}).ToArray();
}
}
}