mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 08:43:20 +08:00
Move around some namespaces.
This commit is contained in:
parent
2ac248c7d0
commit
bc01935a89
@ -6,6 +6,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Framework.Screens.Testing;
|
||||
using osu.Game.Screens.Tournament;
|
||||
using osu.Game.Screens.Tournament.Teams;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
|
@ -18,6 +18,7 @@ using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using osu.Game.Screens.Tournament.Components;
|
||||
using osu.Game.Screens.Tournament.Teams;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
@ -51,7 +52,7 @@ namespace osu.Game.Screens.Tournament
|
||||
this.storage = storage;
|
||||
|
||||
if (TeamList == null)
|
||||
TeamList = new FileTeamList(storage);
|
||||
TeamList = new StorageBackedTeamList(storage);
|
||||
|
||||
if (!TeamList.Teams.Any())
|
||||
{
|
||||
@ -244,7 +245,7 @@ namespace osu.Game.Screens.Tournament
|
||||
fullTeamNameText.Text = team.FullName;
|
||||
fullTeamNameText.FadeIn(200);
|
||||
|
||||
writeResults(groupsContainer.ToStringRepresentation());
|
||||
writeResults(groupsContainer.GetStringRepresentation());
|
||||
}
|
||||
|
||||
private void writeResults(string text)
|
||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Screens.Tournament.Teams;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
@ -58,7 +59,7 @@ namespace osu.Game.Screens.Tournament
|
||||
teams = new FillFlowContainer<GroupTeam>
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
|
||||
|
||||
Spacing = new Vector2(6f, 22),
|
||||
|
||||
Margin = new MarginPadding
|
||||
@ -111,7 +112,7 @@ namespace osu.Game.Screens.Tournament
|
||||
TeamsCount = 0;
|
||||
}
|
||||
|
||||
public string ToStringRepresentation()
|
||||
public string GetStringRepresentation()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
foreach (GroupTeam gt in allTeams)
|
||||
@ -130,7 +131,7 @@ namespace osu.Game.Screens.Tournament
|
||||
{
|
||||
Team = team;
|
||||
|
||||
Size = new Vector2(36, 0);
|
||||
Width = 36;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
|
||||
Children = new Drawable[]
|
||||
@ -146,8 +147,6 @@ namespace osu.Game.Screens.Tournament
|
||||
Direction = FillDirection.Down,
|
||||
Spacing = new Vector2(0, 5f),
|
||||
|
||||
Scale = new Vector2(1.5f),
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
flagSprite = new Sprite
|
||||
@ -174,6 +173,7 @@ namespace osu.Game.Screens.Tournament
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
innerContainer.ScaleTo(1.5f);
|
||||
innerContainer.ScaleTo(1f, 200);
|
||||
}
|
||||
|
||||
|
@ -1,33 +1,33 @@
|
||||
using OpenTK;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Screens.Tournament.Teams;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Screens.Tournament
|
||||
{
|
||||
public class GroupsContainer : Container
|
||||
{
|
||||
private FlowContainer<Group> topGroups;
|
||||
private FlowContainer<Group> bottomGroups;
|
||||
|
||||
private List<Group> allGroups = new List<Group>();
|
||||
private List<Group> groups = new List<Group>();
|
||||
|
||||
private int maxTeams;
|
||||
private int currentGroup;
|
||||
|
||||
public GroupsContainer(int numGroups, int teamsPerGroup)
|
||||
{
|
||||
FlowContainer<Group> bottomGroups;
|
||||
FlowContainer<Group> topGroups;
|
||||
|
||||
maxTeams = teamsPerGroup;
|
||||
|
||||
char nextGroupName = 'A';
|
||||
|
||||
Children = new[]
|
||||
{
|
||||
topGroups = new FillFlowContainer<Group>()
|
||||
topGroups = new FillFlowContainer<Group>
|
||||
{
|
||||
Anchor = Anchor.TopCentre,
|
||||
Origin = Anchor.TopCentre,
|
||||
@ -36,7 +36,7 @@ namespace osu.Game.Screens.Tournament
|
||||
|
||||
Spacing = new Vector2(7f, 0)
|
||||
},
|
||||
bottomGroups = new FillFlowContainer<Group>()
|
||||
bottomGroups = new FillFlowContainer<Group>
|
||||
{
|
||||
Anchor = Anchor.BottomCentre,
|
||||
Origin = Anchor.BottomCentre,
|
||||
@ -51,7 +51,7 @@ namespace osu.Game.Screens.Tournament
|
||||
{
|
||||
Group g = new Group(nextGroupName.ToString());
|
||||
|
||||
allGroups.Add(g);
|
||||
groups.Add(g);
|
||||
nextGroupName++;
|
||||
|
||||
if (i < (int)Math.Ceiling(numGroups / 2f))
|
||||
@ -63,37 +63,37 @@ namespace osu.Game.Screens.Tournament
|
||||
|
||||
public void AddTeam(Team team)
|
||||
{
|
||||
if (allGroups[currentGroup].TeamsCount == maxTeams)
|
||||
if (groups[currentGroup].TeamsCount == maxTeams)
|
||||
return;
|
||||
|
||||
allGroups[currentGroup].AddTeam(team);
|
||||
groups[currentGroup].AddTeam(team);
|
||||
|
||||
currentGroup = (currentGroup + 1) % allGroups.Count;
|
||||
currentGroup = (currentGroup + 1) % groups.Count;
|
||||
}
|
||||
|
||||
public bool ContainsTeam(string fullName)
|
||||
{
|
||||
return allGroups.Any(g => g.ContainsTeam(fullName));
|
||||
return groups.Any(g => g.ContainsTeam(fullName));
|
||||
}
|
||||
|
||||
public void ClearTeams()
|
||||
{
|
||||
foreach (Group g in allGroups)
|
||||
foreach (Group g in groups)
|
||||
g.ClearTeams();
|
||||
|
||||
currentGroup = 0;
|
||||
}
|
||||
|
||||
public string ToStringRepresentation()
|
||||
public string GetStringRepresentation()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
foreach (Group g in allGroups)
|
||||
foreach (Group g in groups)
|
||||
{
|
||||
if (g != allGroups.First())
|
||||
if (g != groups.First())
|
||||
sb.AppendLine();
|
||||
sb.AppendLine($"Group {g.GroupName}");
|
||||
sb.Append(g.ToStringRepresentation());
|
||||
sb.Append(g.GetStringRepresentation());
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
|
@ -12,6 +12,7 @@ using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.Graphics.Transforms;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Screens.Tournament.Teams;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace osu.Game.Screens.Tournament
|
||||
namespace osu.Game.Screens.Tournament.Teams
|
||||
{
|
||||
public interface ITeamList
|
||||
{
|
@ -1,21 +1,21 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Platform;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Platform;
|
||||
|
||||
namespace osu.Game.Screens.Tournament
|
||||
namespace osu.Game.Screens.Tournament.Teams
|
||||
{
|
||||
public class FileTeamList : ITeamList
|
||||
public class StorageBackedTeamList : ITeamList
|
||||
{
|
||||
private const string teams_filename = "drawings.txt";
|
||||
|
||||
private Storage storage;
|
||||
|
||||
public FileTeamList(Storage storage)
|
||||
public StorageBackedTeamList(Storage storage)
|
||||
{
|
||||
this.storage = storage;
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Screens.Tournament
|
||||
namespace osu.Game.Screens.Tournament.Teams
|
||||
{
|
||||
public class Team
|
||||
{
|
@ -216,10 +216,10 @@
|
||||
<Compile Include="Screens\Tournament\Drawings.cs" />
|
||||
<Compile Include="Screens\Tournament\Group.cs" />
|
||||
<Compile Include="Screens\Tournament\GroupsContainer.cs" />
|
||||
<Compile Include="Screens\Tournament\ITeamList.cs" />
|
||||
<Compile Include="Screens\Tournament\Teams\ITeamList.cs" />
|
||||
<Compile Include="Screens\Tournament\ScrollingTeamContainer.cs" />
|
||||
<Compile Include="Screens\Tournament\Team.cs" />
|
||||
<Compile Include="Screens\Tournament\FileTeamList.cs" />
|
||||
<Compile Include="Screens\Tournament\Teams\Team.cs" />
|
||||
<Compile Include="Screens\Tournament\Teams\StorageBackedTeamList.cs" />
|
||||
<Compile Include="Users\User.cs" />
|
||||
<Compile Include="Graphics\UserInterface\Volume\VolumeControl.cs" />
|
||||
<Compile Include="Database\BeatmapDatabase.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user