1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-19 22:12:58 +08:00
osu-lazer/osu.Game.Tournament.Tests/Screens/TestSceneSeedingScreen.cs

128 lines
5.6 KiB
C#
Raw Normal View History

2020-03-03 17:12:42 +08: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.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
using osu.Game.Tournament.Models;
using osu.Game.Tournament.Screens.TeamIntro;
using osu.Game.Users;
namespace osu.Game.Tournament.Tests.Screens
{
public class TestSceneSeedingScreen : LadderTestScene
{
[Cached]
private readonly LadderInfo ladder = new LadderInfo();
[BackgroundDependencyLoader]
private void load()
{
2020-03-04 12:26:25 +08:00
ladder.CurrentMatch.Value = CreateSampleSeededMatch();
Add(new SeedingScreen
2020-03-03 17:12:42 +08:00
{
2020-03-04 12:26:25 +08:00
FillMode = FillMode.Fit,
FillAspectRatio = 16 / 9f
});
}
public static TournamentMatch CreateSampleSeededMatch() => new TournamentMatch
{
Team1 =
{
Value = new TournamentTeam
2020-03-03 17:12:42 +08:00
{
2020-03-04 12:26:25 +08:00
FlagName = { Value = "JP" },
FullName = { Value = "Japan" },
LastYearPlacing = { Value = 10 },
Seed = { Value = "Low" },
SeedingResults =
2020-03-03 17:12:42 +08:00
{
2020-03-04 12:26:25 +08:00
new SeedingResult
2020-03-03 17:12:42 +08:00
{
2020-03-04 12:26:25 +08:00
Mod = { Value = "NM" },
Seed = { Value = 10 },
Beatmaps =
2020-03-03 17:12:42 +08:00
{
2020-03-04 12:26:25 +08:00
new SeedingBeatmap
2020-03-03 17:12:42 +08:00
{
2020-03-04 12:26:25 +08:00
BeatmapInfo = new BeatmapInfo { Metadata = new BeatmapMetadata { Title = "Test Title", Artist = "Test Artist" } },
Score = 12345672,
Seed = { Value = 24 },
},
new SeedingBeatmap
{
BeatmapInfo = new BeatmapInfo { Metadata = new BeatmapMetadata { Title = "Test Title", Artist = "Test Artist" } },
Score = 1234567,
Seed = { Value = 12 },
},
new SeedingBeatmap
2020-03-03 17:12:42 +08:00
{
2020-03-04 12:26:25 +08:00
BeatmapInfo = new BeatmapInfo { Metadata = new BeatmapMetadata { Title = "Test Title", Artist = "Test Artist" } },
Score = 1234567,
Seed = { Value = 16 },
2020-03-03 17:12:42 +08:00
}
}
},
2020-03-04 12:26:25 +08:00
new SeedingResult
2020-03-03 17:12:42 +08:00
{
2020-03-04 12:26:25 +08:00
Mod = { Value = "DT" },
Seed = { Value = 5 },
Beatmaps =
{
new SeedingBeatmap
{
BeatmapInfo = new BeatmapInfo { Metadata = new BeatmapMetadata { Title = "Test Title", Artist = "Test Artist" } },
Score = 234567,
Seed = { Value = 3 },
},
new SeedingBeatmap
{
BeatmapInfo = new BeatmapInfo { Metadata = new BeatmapMetadata { Title = "Test Title", Artist = "Test Artist" } },
Score = 234567,
Seed = { Value = 6 },
},
new SeedingBeatmap
{
BeatmapInfo = new BeatmapInfo { Metadata = new BeatmapMetadata { Title = "Test Title", Artist = "Test Artist" } },
Score = 234567,
Seed = { Value = 12 },
}
}
2020-03-03 17:12:42 +08:00
}
2020-03-04 12:26:25 +08:00
},
Players =
{
new User { Username = "Hello", Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 12 } } },
new User { Username = "Hello", Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 16 } } },
new User { Username = "Hello", Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 20 } } },
new User { Username = "Hello", Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 24 } } },
new User { Username = "Hello", Statistics = new UserStatistics { Ranks = new UserStatistics.UserRanks { Global = 30 } } },
2020-03-03 17:12:42 +08:00
}
2020-03-04 12:26:25 +08:00
}
},
Team2 =
{
Value = new TournamentTeam
2020-03-03 17:12:42 +08:00
{
2020-03-04 12:26:25 +08:00
FlagName = { Value = "US" },
FullName = { Value = "United States" },
Players =
2020-03-03 17:12:42 +08:00
{
2020-03-04 12:26:25 +08:00
new User { Username = "Hello" },
new User { Username = "Hello" },
new User { Username = "Hello" },
new User { Username = "Hello" },
new User { Username = "Hello" },
2020-03-03 17:12:42 +08:00
}
}
2020-03-04 12:26:25 +08:00
},
Round =
2020-03-03 17:12:42 +08:00
{
2020-03-04 12:26:25 +08:00
Value = new TournamentRound { Name = { Value = "Quarterfinals" } }
}
};
2020-03-03 17:12:42 +08:00
}
}