diff --git a/osu.Game/Screens/Tournament/Group.cs b/osu.Game/Screens/Tournament/Group.cs index 3ceb30becb..f0aa79edc8 100644 --- a/osu.Game/Screens/Tournament/Group.cs +++ b/osu.Game/Screens/Tournament/Group.cs @@ -22,16 +22,12 @@ namespace osu.Game.Screens.Tournament { public string GroupName; - public int TeamsCount => topTeamsCount + bottomTeamsCount; + public int TeamsCount { get; private set; } - private FlowContainer topTeams; - private FlowContainer bottomTeams; + private FlowContainer teams; private List allTeams = new List(); - private int topTeamsCount; - private int bottomTeamsCount; - public Group(string name) { GroupName = name; @@ -61,59 +57,33 @@ namespace osu.Game.Screens.Tournament Font = @"Exo2.0-Bold", Colour = new Color4(255, 204, 34, 255), }, - topTeams = new FillFlowContainer() + teams = new FillFlowContainer() { - AutoSizeAxes = Axes.Y, - RelativeSizeAxes = Axes.X, + RelativeSizeAxes = Axes.Both, + + Spacing = new Vector2(6f, 22), - Position = new Vector2(0, 21f), - Spacing = new Vector2(6f, 0), - - Padding = new MarginPadding() + Margin = new MarginPadding() { + Top = 21f, + Bottom = 7f, Left = 7f, Right = 7f - }, - - Direction = FillDirection.Right - }, - bottomTeams = new FillFlowContainer() - { - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - - AutoSizeAxes = Axes.Y, - RelativeSizeAxes = Axes.X, - - Position = new Vector2(0, -7f), - Spacing = new Vector2(6f, 0), - - Padding = new MarginPadding() - { - Left = 7f, - Right = 7f - }, - - Direction = FillDirection.Right + } } }; } public void AddTeam(Team team) { - GroupTeam gt = new GroupTeam(team); - if (topTeamsCount < 4) + + if (TeamsCount < 8) { - topTeams.Add(gt); + teams.Add(gt); allTeams.Add(gt); - topTeamsCount++; - } - else if (bottomTeamsCount < 4) - { - bottomTeams.Add(gt); - allTeams.Add(gt); - bottomTeamsCount++; + + TeamsCount++; } } @@ -126,14 +96,9 @@ namespace osu.Game.Screens.Tournament { allTeams.RemoveAll(gt => gt.Team == team); - if (topTeams.RemoveAll(gt => gt.Team == team) > 0) + if (teams.RemoveAll(gt => gt.Team == team) > 0) { - topTeamsCount--; - return true; - } - else if (bottomTeams.RemoveAll(gt => gt.Team == team) > 0) - { - bottomTeamsCount--; + TeamsCount--; return true; } @@ -143,11 +108,9 @@ namespace osu.Game.Screens.Tournament public void ClearTeams() { allTeams.Clear(); - topTeams.Clear(); - bottomTeams.Clear(); + teams.Clear(); - topTeamsCount = 0; - bottomTeamsCount = 0; + TeamsCount = 0; } public string ToStringRepresentation()