Skip to content

Commit 51dcfee

Browse files
committed
Move existing tournament resources to new project
1 parent 1eb0277 commit 51dcfee

File tree

18 files changed

+201
-88
lines changed

18 files changed

+201
-88
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "VisualTests (Debug)",
6+
"type": "coreclr",
7+
"request": "launch",
8+
"program": "dotnet",
9+
"args": [
10+
"${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Tournament.Tests.dll"
11+
],
12+
"cwd": "${workspaceRoot}",
13+
"preLaunchTask": "Build (Debug)",
14+
"env": {},
15+
"console": "internalConsole"
16+
},
17+
{
18+
"name": "VisualTests (Release)",
19+
"type": "coreclr",
20+
"request": "launch",
21+
"program": "dotnet",
22+
"args": [
23+
"${workspaceRoot}/bin/Release/netcoreapp2.1/osu.Game.Tournament.Tests.dll"
24+
],
25+
"cwd": "${workspaceRoot}",
26+
"preLaunchTask": "Build (Release)",
27+
"env": {},
28+
"console": "internalConsole"
29+
}
30+
]
31+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "Build (Debug)",
8+
"type": "shell",
9+
"command": "dotnet",
10+
"args": [
11+
"build",
12+
"--no-restore",
13+
"osu.Game.Tournament.Tests.csproj",
14+
"/p:GenerateFullPaths=true",
15+
"/m",
16+
"/verbosity:m"
17+
],
18+
"group": "build",
19+
"problemMatcher": "$msCompile"
20+
},
21+
{
22+
"label": "Build (Release)",
23+
"type": "shell",
24+
"command": "dotnet",
25+
"args": [
26+
"build",
27+
"--no-restore",
28+
"osu.Game.Tournament.Tests.csproj",
29+
"/p:Configuration=Release",
30+
"/p:GenerateFullPaths=true",
31+
"/m",
32+
"/verbosity:m"
33+
],
34+
"group": "build",
35+
"problemMatcher": "$msCompile"
36+
},
37+
{
38+
"label": "Restore",
39+
"type": "shell",
40+
"command": "dotnet",
41+
"args": [
42+
"restore"
43+
],
44+
"problemMatcher": []
45+
}
46+
]
47+
}

osu.Game.Tests/Visual/TestCaseDrawings.cs renamed to osu.Game.Tournament.Tests/TestCaseDrawings.cs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,76 +2,75 @@
22
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
33

44
using System.Collections.Generic;
5-
using System.ComponentModel;
6-
using osu.Game.Screens.Tournament;
7-
using osu.Game.Screens.Tournament.Teams;
5+
using osu.Game.Tests.Visual;
6+
using osu.Game.Tournament.Screens.Drawings;
7+
using osu.Game.Tournament.Screens.Drawings.Components;
88

9-
namespace osu.Game.Tests.Visual
9+
namespace osu.Game.Tournament.Tests
1010
{
11-
[Description("for tournament use")]
1211
public class TestCaseDrawings : OsuTestCase
1312
{
1413
public TestCaseDrawings()
1514
{
16-
Add(new Drawings
15+
Add(new DrawingsScreen
1716
{
1817
TeamList = new TestTeamList(),
1918
});
2019
}
2120

2221
private class TestTeamList : ITeamList
2322
{
24-
public IEnumerable<DrawingsTeam> Teams { get; } = new[]
23+
public IEnumerable<TournamentTeam> Teams { get; } = new[]
2524
{
26-
new DrawingsTeam
25+
new TournamentTeam
2726
{
2827
FlagName = "GB",
2928
FullName = "United Kingdom",
3029
Acronym = "UK"
3130
},
32-
new DrawingsTeam
31+
new TournamentTeam
3332
{
3433
FlagName = "FR",
3534
FullName = "France",
3635
Acronym = "FRA"
3736
},
38-
new DrawingsTeam
37+
new TournamentTeam
3938
{
4039
FlagName = "CN",
4140
FullName = "China",
4241
Acronym = "CHN"
4342
},
44-
new DrawingsTeam
43+
new TournamentTeam
4544
{
4645
FlagName = "AU",
4746
FullName = "Australia",
4847
Acronym = "AUS"
4948
},
50-
new DrawingsTeam
49+
new TournamentTeam
5150
{
5251
FlagName = "JP",
5352
FullName = "Japan",
5453
Acronym = "JPN"
5554
},
56-
new DrawingsTeam
55+
new TournamentTeam
5756
{
5857
FlagName = "RO",
5958
FullName = "Romania",
6059
Acronym = "ROM"
6160
},
62-
new DrawingsTeam
61+
new TournamentTeam
6362
{
6463
FlagName = "IT",
6564
FullName = "Italy",
6665
Acronym = "PIZZA"
6766
},
68-
new DrawingsTeam
67+
new TournamentTeam
6968
{
7069
FlagName = "VE",
7170
FullName = "Venezuela",
7271
Acronym = "VNZ"
7372
},
74-
new DrawingsTeam
73+
new TournamentTeam
7574
{
7675
FlagName = "US",
7776
FullName = "United States of America",
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<Import Project="..\osu.TestProject.props" />
3+
<ItemGroup Label="Package References">
4+
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
5+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
6+
<PackageReference Include="NUnit" Version="3.10.1" />
7+
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
8+
</ItemGroup>
9+
<PropertyGroup Label="Project">
10+
<OutputType>WinExe</OutputType>
11+
<TargetFramework>netcoreapp2.1</TargetFramework>
12+
</PropertyGroup>
13+
<ItemGroup Label="Project References">
14+
<ProjectReference Include="..\osu.Game.Tournament\osu.Game.Tournament.csproj" />
15+
</ItemGroup>
16+
</Project>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
2+
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
3+
4+
using System.Runtime.CompilerServices;
5+
6+
// We publish our internal attributes to other sub-projects of the framework.
7+
// Note, that we omit visual tests as they are meant to test the framework
8+
// behavior "in the wild".
9+
10+
[assembly: InternalsVisibleTo("osu.Game.Tournament.Tests")]
11+
[assembly: InternalsVisibleTo("osu.Game.Tournament.Tests.Dynamic")]

osu.Game/Screens/Tournament/Components/DrawingsConfigManager.cs renamed to osu.Game.Tournament/Screens/Drawings/Components/DrawingsConfigManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using osu.Framework.Configuration;
55
using osu.Framework.Platform;
66

7-
namespace osu.Game.Screens.Tournament.Components
7+
namespace osu.Game.Tournament.Screens.Drawings.Components
88
{
99
public class DrawingsConfigManager : IniConfigManager<DrawingsConfig>
1010
{

osu.Game/Screens/Tournament/Teams/DrawingsTeam.cs renamed to osu.Game.Tournament/Screens/Drawings/Components/DrawingsTeam.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
22
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
33

4-
namespace osu.Game.Screens.Tournament.Teams
4+
namespace osu.Game.Tournament.Screens.Drawings.Components
55
{
6-
public class DrawingsTeam
6+
public class TournamentTeam
77
{
88
/// <summary>
99
/// The name of this team.
1010
/// </summary>
1111
public string FullName;
1212

1313
/// <summary>
14-
/// Short acronym which appears in the group boxes post-selection.
14+
/// Name of the file containing the flag.
1515
/// </summary>
16-
public string Acronym;
16+
public string FlagName;
17+
18+
private string acronym;
1719

1820
/// <summary>
19-
/// Name of the file containing the flag.
21+
/// Short acronym which appears in the group boxes post-selection.
2022
/// </summary>
21-
public string FlagName;
23+
public string Acronym
24+
{
25+
get { return acronym ?? FullName.Substring(0, 3); }
26+
set { acronym = value; }
27+
}
2228
}
2329
}

osu.Game/Screens/Tournament/Group.cs renamed to osu.Game.Tournament/Screens/Drawings/Components/Group.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@
77
using osu.Framework.Allocation;
88
using osu.Framework.Graphics;
99
using osu.Framework.Graphics.Containers;
10+
using osu.Framework.Graphics.Shapes;
1011
using osu.Framework.Graphics.Sprites;
1112
using osu.Framework.Graphics.Textures;
1213
using osu.Game.Graphics.Sprites;
1314
using OpenTK;
1415
using OpenTK.Graphics;
15-
using osu.Game.Screens.Tournament.Teams;
16-
using osu.Framework.Graphics.Shapes;
1716

18-
namespace osu.Game.Screens.Tournament
17+
namespace osu.Game.Tournament.Screens.Drawings.Components
1918
{
2019
public class Group : Container
2120
{
@@ -73,7 +72,7 @@ public Group(string name)
7372
};
7473
}
7574

76-
public void AddTeam(DrawingsTeam team)
75+
public void AddTeam(TournamentTeam team)
7776
{
7877
GroupTeam gt = new GroupTeam(team);
7978

@@ -91,7 +90,7 @@ public bool ContainsTeam(string fullName)
9190
return allTeams.Any(t => t.Team.FullName == fullName);
9291
}
9392

94-
public bool RemoveTeam(DrawingsTeam team)
93+
public bool RemoveTeam(TournamentTeam team)
9594
{
9695
allTeams.RemoveAll(gt => gt.Team == team);
9796

@@ -122,12 +121,12 @@ public string GetStringRepresentation()
122121

123122
private class GroupTeam : Container
124123
{
125-
public readonly DrawingsTeam Team;
124+
public readonly TournamentTeam Team;
126125

127126
private readonly FillFlowContainer innerContainer;
128127
private readonly Sprite flagSprite;
129128

130-
public GroupTeam(DrawingsTeam team)
129+
public GroupTeam(TournamentTeam team)
131130
{
132131
Team = team;
133132

osu.Game/Screens/Tournament/GroupContainer.cs renamed to osu.Game.Tournament/Screens/Drawings/Components/GroupContainer.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
using osu.Framework.Graphics;
99
using osu.Framework.Graphics.Containers;
1010
using OpenTK;
11-
using osu.Game.Screens.Tournament.Teams;
1211

13-
namespace osu.Game.Screens.Tournament
12+
namespace osu.Game.Tournament.Screens.Drawings.Components
1413
{
1514
public class GroupContainer : Container
1615
{
@@ -64,7 +63,7 @@ public GroupContainer(int numGroups, int teamsPerGroup)
6463
}
6564
}
6665

67-
public void AddTeam(DrawingsTeam team)
66+
public void AddTeam(TournamentTeam team)
6867
{
6968
if (groups[currentGroup].TeamsCount == maxTeams)
7069
return;

osu.Game/Screens/Tournament/Teams/ITeamList.cs renamed to osu.Game.Tournament/Screens/Drawings/Components/ITeamList.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
using System.Collections.Generic;
55

6-
namespace osu.Game.Screens.Tournament.Teams
6+
namespace osu.Game.Tournament.Screens.Drawings.Components
77
{
88
public interface ITeamList
99
{
10-
IEnumerable<DrawingsTeam> Teams { get; }
10+
IEnumerable<TournamentTeam> Teams { get; }
1111
}
1212
}

0 commit comments

Comments
 (0)