1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 11:07:25 +08:00
osu-lazer/osu.Game.Tournament.Tests/TestCaseMapPool.cs

52 lines
1.4 KiB
C#
Raw Normal View History

2018-10-14 17:09:22 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Linq;
using osu.Framework.Allocation;
2018-10-14 17:09:22 +08:00
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
2018-10-16 14:25:56 +08:00
using osu.Game.Screens;
2018-10-14 17:09:22 +08:00
using osu.Game.Tournament.Components;
using osu.Game.Tournament.Screens.Ladder.Components;
2018-10-16 14:25:56 +08:00
using OpenTK;
2018-10-14 17:09:22 +08:00
namespace osu.Game.Tournament.Tests
{
public class TestCaseMapPool : LadderTestCase
{
[BackgroundDependencyLoader]
private void load()
2018-10-14 17:09:22 +08:00
{
var round = Ladder.Groupings.First(g => g.Name == "Finals");
Add(new MapPoolScreen(round));
}
}
2018-10-16 14:25:56 +08:00
public class MapPoolScreen : OsuScreen
2018-10-14 17:09:22 +08:00
{
public MapPoolScreen(TournamentGrouping round)
{
FillFlowContainer maps;
2018-10-14 17:09:22 +08:00
InternalChildren = new Drawable[]
{
maps = new FillFlowContainer
{
2018-10-16 14:25:56 +08:00
Spacing = new Vector2(20),
Padding = new MarginPadding(50),
2018-10-14 17:09:22 +08:00
Direction = FillDirection.Full,
RelativeSizeAxes = Axes.Both,
},
};
foreach (var b in round.Beatmaps)
2018-10-16 14:25:56 +08:00
maps.Add(new TournamentBeatmapPanel(b.BeatmapInfo)
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
});
2018-10-14 17:09:22 +08:00
}
}
}