2020-03-06 07:07:54 +00: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.
|
|
|
|
|
|
2023-10-28 07:18:15 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
2020-03-07 03:51:11 +00:00
|
|
|
|
using osu.Framework.Bindables;
|
2020-03-06 07:07:54 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Tests.Visual;
|
|
|
|
|
using osu.Game.Tournament.Components;
|
|
|
|
|
using osu.Game.Tournament.Models;
|
|
|
|
|
using osu.Game.Tournament.Screens.Drawings.Components;
|
|
|
|
|
using osu.Game.Tournament.Screens.Gameplay.Components;
|
|
|
|
|
using osu.Game.Tournament.Screens.Ladder.Components;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tournament.Tests.Components
|
|
|
|
|
{
|
|
|
|
|
public partial class TestSceneDrawableTournamentTeam : OsuGridTestScene
|
|
|
|
|
{
|
2023-10-28 07:18:15 +00:00
|
|
|
|
[Cached]
|
|
|
|
|
protected LadderInfo Ladder { get; private set; } = new LadderInfo();
|
|
|
|
|
|
2020-03-06 07:07:54 +00:00
|
|
|
|
public TestSceneDrawableTournamentTeam()
|
|
|
|
|
: base(4, 3)
|
|
|
|
|
{
|
2023-10-28 07:18:15 +00:00
|
|
|
|
AddToggleStep("toggle seed view", v => Ladder.DisplayTeamSeeds.Value = v);
|
|
|
|
|
|
2020-03-06 07:07:54 +00:00
|
|
|
|
var team = new TournamentTeam
|
|
|
|
|
{
|
|
|
|
|
FlagName = { Value = "AU" },
|
|
|
|
|
FullName = { Value = "Australia" },
|
2023-10-28 05:29:46 +00:00
|
|
|
|
Seed = { Value = "#5" },
|
2020-03-06 07:07:54 +00:00
|
|
|
|
Players =
|
|
|
|
|
{
|
2022-06-17 23:33:26 +00:00
|
|
|
|
new TournamentUser { Username = "ASecretBox" },
|
|
|
|
|
new TournamentUser { Username = "Dereban" },
|
|
|
|
|
new TournamentUser { Username = "mReKk" },
|
|
|
|
|
new TournamentUser { Username = "uyghti" },
|
|
|
|
|
new TournamentUser { Username = "Parkes" },
|
|
|
|
|
new TournamentUser { Username = "Shiroha" },
|
|
|
|
|
new TournamentUser { Username = "Jordan The Bear" },
|
2023-10-28 05:29:46 +00:00
|
|
|
|
},
|
2020-03-06 07:07:54 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var match = new TournamentMatch { Team1 = { Value = team } };
|
|
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
|
|
Cell(i++).AddRange(new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new TournamentSpriteText { Text = "DrawableTeamFlag" },
|
|
|
|
|
new DrawableTeamFlag(team)
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cell(i++).AddRange(new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new TournamentSpriteText { Text = "DrawableTeamTitle" },
|
|
|
|
|
new DrawableTeamTitle(team)
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cell(i++).AddRange(new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new TournamentSpriteText { Text = "DrawableTeamTitleWithHeader" },
|
|
|
|
|
new DrawableTeamTitleWithHeader(team, TeamColour.Red)
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cell(i++).AddRange(new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new TournamentSpriteText { Text = "DrawableMatchTeam" },
|
|
|
|
|
new DrawableMatchTeam(team, match, false)
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cell(i++).AddRange(new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new TournamentSpriteText { Text = "TeamWithPlayers" },
|
|
|
|
|
new DrawableTeamWithPlayers(team, TeamColour.Blue)
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cell(i++).AddRange(new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new TournamentSpriteText { Text = "GroupTeam" },
|
|
|
|
|
new GroupTeam(team)
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Cell(i).AddRange(new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new TournamentSpriteText { Text = "TeamDisplay" },
|
2023-10-28 06:25:55 +00:00
|
|
|
|
new TeamDisplay(team, TeamColour.Red, new Bindable<int?>(2), 6)
|
2020-03-06 07:07:54 +00:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|