1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-06 14:37:21 +08:00
osu-lazer/osu.Game.Tournament.Tests/Components/TestSceneTournamentBeatmapPanel.cs

43 lines
1.2 KiB
C#
Raw Normal View History

2019-03-04 13:24:19 +09:00
// 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.
2018-10-14 00:40:33 +09:00
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Rulesets;
using osu.Game.Tests.Visual;
using osu.Game.Tournament.Components;
2019-06-18 15:28:36 +09:00
namespace osu.Game.Tournament.Tests.Components
2018-10-14 00:40:33 +09:00
{
2019-06-18 15:28:36 +09:00
public class TestSceneTournamentBeatmapPanel : OsuTestScene
2018-10-14 00:40:33 +09:00
{
[Resolved]
private IAPIProvider api { get; set; }
2018-10-14 00:40:33 +09:00
[Resolved]
2018-11-06 14:49:20 +09:00
private RulesetStore rulesets { get; set; }
2018-10-14 00:40:33 +09:00
[BackgroundDependencyLoader]
private void load()
{
var req = new GetBeatmapRequest(new BeatmapInfo { OnlineBeatmapID = 1091460 });
req.Success += success;
2018-10-14 03:03:17 +09:00
api.Queue(req);
2018-10-14 00:40:33 +09:00
}
private void success(APIBeatmap apiBeatmap)
{
2018-10-14 03:03:17 +09:00
var beatmap = apiBeatmap.ToBeatmap(rulesets);
2018-10-14 00:40:33 +09:00
Add(new TournamentBeatmapPanel(beatmap)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre
});
}
}
}