mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Move existing tournament resources to new project
This commit is contained in:
parent
1eb0277ba3
commit
51dcfeee92
31
osu.Game.Tournament.Tests/.vscode/launch.json
vendored
Normal file
31
osu.Game.Tournament.Tests/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "VisualTests (Debug)",
|
||||||
|
"type": "coreclr",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"${workspaceRoot}/bin/Debug/netcoreapp2.1/osu.Game.Tournament.Tests.dll"
|
||||||
|
],
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build (Debug)",
|
||||||
|
"env": {},
|
||||||
|
"console": "internalConsole"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "VisualTests (Release)",
|
||||||
|
"type": "coreclr",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"${workspaceRoot}/bin/Release/netcoreapp2.1/osu.Game.Tournament.Tests.dll"
|
||||||
|
],
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build (Release)",
|
||||||
|
"env": {},
|
||||||
|
"console": "internalConsole"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
47
osu.Game.Tournament.Tests/.vscode/tasks.json
vendored
Normal file
47
osu.Game.Tournament.Tests/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Build (Debug)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"build",
|
||||||
|
"--no-restore",
|
||||||
|
"osu.Game.Tournament.Tests.csproj",
|
||||||
|
"/p:GenerateFullPaths=true",
|
||||||
|
"/m",
|
||||||
|
"/verbosity:m"
|
||||||
|
],
|
||||||
|
"group": "build",
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Build (Release)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"build",
|
||||||
|
"--no-restore",
|
||||||
|
"osu.Game.Tournament.Tests.csproj",
|
||||||
|
"/p:Configuration=Release",
|
||||||
|
"/p:GenerateFullPaths=true",
|
||||||
|
"/m",
|
||||||
|
"/verbosity:m"
|
||||||
|
],
|
||||||
|
"group": "build",
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Restore",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"restore"
|
||||||
|
],
|
||||||
|
"problemMatcher": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -2,18 +2,17 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using osu.Game.Tests.Visual;
|
||||||
using osu.Game.Screens.Tournament;
|
using osu.Game.Tournament.Screens.Drawings;
|
||||||
using osu.Game.Screens.Tournament.Teams;
|
using osu.Game.Tournament.Screens.Drawings.Components;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual
|
namespace osu.Game.Tournament.Tests
|
||||||
{
|
{
|
||||||
[Description("for tournament use")]
|
|
||||||
public class TestCaseDrawings : OsuTestCase
|
public class TestCaseDrawings : OsuTestCase
|
||||||
{
|
{
|
||||||
public TestCaseDrawings()
|
public TestCaseDrawings()
|
||||||
{
|
{
|
||||||
Add(new Drawings
|
Add(new DrawingsScreen
|
||||||
{
|
{
|
||||||
TeamList = new TestTeamList(),
|
TeamList = new TestTeamList(),
|
||||||
});
|
});
|
||||||
@ -21,57 +20,57 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
private class TestTeamList : ITeamList
|
private class TestTeamList : ITeamList
|
||||||
{
|
{
|
||||||
public IEnumerable<DrawingsTeam> Teams { get; } = new[]
|
public IEnumerable<TournamentTeam> Teams { get; } = new[]
|
||||||
{
|
{
|
||||||
new DrawingsTeam
|
new TournamentTeam
|
||||||
{
|
{
|
||||||
FlagName = "GB",
|
FlagName = "GB",
|
||||||
FullName = "United Kingdom",
|
FullName = "United Kingdom",
|
||||||
Acronym = "UK"
|
Acronym = "UK"
|
||||||
},
|
},
|
||||||
new DrawingsTeam
|
new TournamentTeam
|
||||||
{
|
{
|
||||||
FlagName = "FR",
|
FlagName = "FR",
|
||||||
FullName = "France",
|
FullName = "France",
|
||||||
Acronym = "FRA"
|
Acronym = "FRA"
|
||||||
},
|
},
|
||||||
new DrawingsTeam
|
new TournamentTeam
|
||||||
{
|
{
|
||||||
FlagName = "CN",
|
FlagName = "CN",
|
||||||
FullName = "China",
|
FullName = "China",
|
||||||
Acronym = "CHN"
|
Acronym = "CHN"
|
||||||
},
|
},
|
||||||
new DrawingsTeam
|
new TournamentTeam
|
||||||
{
|
{
|
||||||
FlagName = "AU",
|
FlagName = "AU",
|
||||||
FullName = "Australia",
|
FullName = "Australia",
|
||||||
Acronym = "AUS"
|
Acronym = "AUS"
|
||||||
},
|
},
|
||||||
new DrawingsTeam
|
new TournamentTeam
|
||||||
{
|
{
|
||||||
FlagName = "JP",
|
FlagName = "JP",
|
||||||
FullName = "Japan",
|
FullName = "Japan",
|
||||||
Acronym = "JPN"
|
Acronym = "JPN"
|
||||||
},
|
},
|
||||||
new DrawingsTeam
|
new TournamentTeam
|
||||||
{
|
{
|
||||||
FlagName = "RO",
|
FlagName = "RO",
|
||||||
FullName = "Romania",
|
FullName = "Romania",
|
||||||
Acronym = "ROM"
|
Acronym = "ROM"
|
||||||
},
|
},
|
||||||
new DrawingsTeam
|
new TournamentTeam
|
||||||
{
|
{
|
||||||
FlagName = "IT",
|
FlagName = "IT",
|
||||||
FullName = "Italy",
|
FullName = "Italy",
|
||||||
Acronym = "PIZZA"
|
Acronym = "PIZZA"
|
||||||
},
|
},
|
||||||
new DrawingsTeam
|
new TournamentTeam
|
||||||
{
|
{
|
||||||
FlagName = "VE",
|
FlagName = "VE",
|
||||||
FullName = "Venezuela",
|
FullName = "Venezuela",
|
||||||
Acronym = "VNZ"
|
Acronym = "VNZ"
|
||||||
},
|
},
|
||||||
new DrawingsTeam
|
new TournamentTeam
|
||||||
{
|
{
|
||||||
FlagName = "US",
|
FlagName = "US",
|
||||||
FullName = "United States of America",
|
FullName = "United States of America",
|
16
osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj
Normal file
16
osu.Game.Tournament.Tests/osu.Game.Tournament.Tests.csproj
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<Import Project="..\osu.TestProject.props" />
|
||||||
|
<ItemGroup Label="Package References">
|
||||||
|
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
|
||||||
|
<PackageReference Include="NUnit" Version="3.10.1" />
|
||||||
|
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Project">
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup Label="Project References">
|
||||||
|
<ProjectReference Include="..\osu.Game.Tournament\osu.Game.Tournament.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
11
osu.Game.Tournament/Properties/AssemblyInfo.cs
Normal file
11
osu.Game.Tournament/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
|
// We publish our internal attributes to other sub-projects of the framework.
|
||||||
|
// Note, that we omit visual tests as they are meant to test the framework
|
||||||
|
// behavior "in the wild".
|
||||||
|
|
||||||
|
[assembly: InternalsVisibleTo("osu.Game.Tournament.Tests")]
|
||||||
|
[assembly: InternalsVisibleTo("osu.Game.Tournament.Tests.Dynamic")]
|
@ -4,7 +4,7 @@
|
|||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Tournament.Components
|
namespace osu.Game.Tournament.Screens.Drawings.Components
|
||||||
{
|
{
|
||||||
public class DrawingsConfigManager : IniConfigManager<DrawingsConfig>
|
public class DrawingsConfigManager : IniConfigManager<DrawingsConfig>
|
||||||
{
|
{
|
@ -1,23 +1,29 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
namespace osu.Game.Screens.Tournament.Teams
|
namespace osu.Game.Tournament.Screens.Drawings.Components
|
||||||
{
|
{
|
||||||
public class DrawingsTeam
|
public class TournamentTeam
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The name of this team.
|
/// The name of this team.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string FullName;
|
public string FullName;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Short acronym which appears in the group boxes post-selection.
|
|
||||||
/// </summary>
|
|
||||||
public string Acronym;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Name of the file containing the flag.
|
/// Name of the file containing the flag.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string FlagName;
|
public string FlagName;
|
||||||
|
|
||||||
|
private string acronym;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Short acronym which appears in the group boxes post-selection.
|
||||||
|
/// </summary>
|
||||||
|
public string Acronym
|
||||||
|
{
|
||||||
|
get { return acronym ?? FullName.Substring(0, 3); }
|
||||||
|
set { acronym = value; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -7,15 +7,14 @@ using System.Text;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Game.Screens.Tournament.Teams;
|
|
||||||
using osu.Framework.Graphics.Shapes;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Tournament
|
namespace osu.Game.Tournament.Screens.Drawings.Components
|
||||||
{
|
{
|
||||||
public class Group : Container
|
public class Group : Container
|
||||||
{
|
{
|
||||||
@ -73,7 +72,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddTeam(DrawingsTeam team)
|
public void AddTeam(TournamentTeam team)
|
||||||
{
|
{
|
||||||
GroupTeam gt = new GroupTeam(team);
|
GroupTeam gt = new GroupTeam(team);
|
||||||
|
|
||||||
@ -91,7 +90,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
return allTeams.Any(t => t.Team.FullName == fullName);
|
return allTeams.Any(t => t.Team.FullName == fullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool RemoveTeam(DrawingsTeam team)
|
public bool RemoveTeam(TournamentTeam team)
|
||||||
{
|
{
|
||||||
allTeams.RemoveAll(gt => gt.Team == team);
|
allTeams.RemoveAll(gt => gt.Team == team);
|
||||||
|
|
||||||
@ -122,12 +121,12 @@ namespace osu.Game.Screens.Tournament
|
|||||||
|
|
||||||
private class GroupTeam : Container
|
private class GroupTeam : Container
|
||||||
{
|
{
|
||||||
public readonly DrawingsTeam Team;
|
public readonly TournamentTeam Team;
|
||||||
|
|
||||||
private readonly FillFlowContainer innerContainer;
|
private readonly FillFlowContainer innerContainer;
|
||||||
private readonly Sprite flagSprite;
|
private readonly Sprite flagSprite;
|
||||||
|
|
||||||
public GroupTeam(DrawingsTeam team)
|
public GroupTeam(TournamentTeam team)
|
||||||
{
|
{
|
||||||
Team = team;
|
Team = team;
|
||||||
|
|
@ -8,9 +8,8 @@ using System.Text;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Game.Screens.Tournament.Teams;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Tournament
|
namespace osu.Game.Tournament.Screens.Drawings.Components
|
||||||
{
|
{
|
||||||
public class GroupContainer : Container
|
public class GroupContainer : Container
|
||||||
{
|
{
|
||||||
@ -64,7 +63,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddTeam(DrawingsTeam team)
|
public void AddTeam(TournamentTeam team)
|
||||||
{
|
{
|
||||||
if (groups[currentGroup].TeamsCount == maxTeams)
|
if (groups[currentGroup].TeamsCount == maxTeams)
|
||||||
return;
|
return;
|
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Tournament.Teams
|
namespace osu.Game.Tournament.Screens.Drawings.Components
|
||||||
{
|
{
|
||||||
public interface ITeamList
|
public interface ITeamList
|
||||||
{
|
{
|
||||||
IEnumerable<DrawingsTeam> Teams { get; }
|
IEnumerable<TournamentTeam> Teams { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -13,18 +13,17 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
using osu.Game.Screens.Tournament.Teams;
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Tournament
|
namespace osu.Game.Tournament.Screens.Drawings.Components
|
||||||
{
|
{
|
||||||
public class ScrollingTeamContainer : Container
|
public class ScrollingTeamContainer : Container
|
||||||
{
|
{
|
||||||
public event Action OnScrollStarted;
|
public event Action OnScrollStarted;
|
||||||
public event Action<DrawingsTeam> OnSelected;
|
public event Action<TournamentTeam> OnSelected;
|
||||||
|
|
||||||
private readonly List<DrawingsTeam> availableTeams = new List<DrawingsTeam>();
|
private readonly List<TournamentTeam> availableTeams = new List<TournamentTeam>();
|
||||||
|
|
||||||
private readonly Container tracker;
|
private readonly Container tracker;
|
||||||
|
|
||||||
@ -84,6 +83,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ScrollState _scrollState;
|
private ScrollState _scrollState;
|
||||||
|
|
||||||
private ScrollState scrollState
|
private ScrollState scrollState
|
||||||
{
|
{
|
||||||
get { return _scrollState; }
|
get { return _scrollState; }
|
||||||
@ -166,7 +166,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddTeam(DrawingsTeam team)
|
public void AddTeam(TournamentTeam team)
|
||||||
{
|
{
|
||||||
if (availableTeams.Contains(team))
|
if (availableTeams.Contains(team))
|
||||||
return;
|
return;
|
||||||
@ -177,12 +177,12 @@ namespace osu.Game.Screens.Tournament
|
|||||||
scrollState = ScrollState.Idle;
|
scrollState = ScrollState.Idle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddTeams(IEnumerable<DrawingsTeam> teams)
|
public void AddTeams(IEnumerable<TournamentTeam> teams)
|
||||||
{
|
{
|
||||||
if (teams == null)
|
if (teams == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (DrawingsTeam t in teams)
|
foreach (TournamentTeam t in teams)
|
||||||
AddTeam(t);
|
AddTeam(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
scrollState = ScrollState.Idle;
|
scrollState = ScrollState.Idle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveTeam(DrawingsTeam team)
|
public void RemoveTeam(TournamentTeam team)
|
||||||
{
|
{
|
||||||
availableTeams.Remove(team);
|
availableTeams.Remove(team);
|
||||||
|
|
||||||
@ -278,7 +278,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
|
|
||||||
private void addFlags()
|
private void addFlags()
|
||||||
{
|
{
|
||||||
foreach (DrawingsTeam t in availableTeams)
|
foreach (TournamentTeam t in availableTeams)
|
||||||
{
|
{
|
||||||
Add(new ScrollingTeam(t)
|
Add(new ScrollingTeam(t)
|
||||||
{
|
{
|
||||||
@ -320,12 +320,13 @@ namespace osu.Game.Screens.Tournament
|
|||||||
public const float WIDTH = 58;
|
public const float WIDTH = 58;
|
||||||
public const float HEIGHT = 41;
|
public const float HEIGHT = 41;
|
||||||
|
|
||||||
public DrawingsTeam Team;
|
public TournamentTeam Team;
|
||||||
|
|
||||||
private readonly Sprite flagSprite;
|
private readonly Sprite flagSprite;
|
||||||
private readonly Box outline;
|
private readonly Box outline;
|
||||||
|
|
||||||
private bool selected;
|
private bool selected;
|
||||||
|
|
||||||
public bool Selected
|
public bool Selected
|
||||||
{
|
{
|
||||||
get { return selected; }
|
get { return selected; }
|
||||||
@ -341,7 +342,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ScrollingTeam(DrawingsTeam team)
|
public ScrollingTeam(TournamentTeam team)
|
||||||
{
|
{
|
||||||
Team = team;
|
Team = team;
|
||||||
|
|
@ -7,7 +7,7 @@ using System.IO;
|
|||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Tournament.Teams
|
namespace osu.Game.Tournament.Screens.Drawings.Components
|
||||||
{
|
{
|
||||||
public class StorageBackedTeamList : ITeamList
|
public class StorageBackedTeamList : ITeamList
|
||||||
{
|
{
|
||||||
@ -20,11 +20,11 @@ namespace osu.Game.Screens.Tournament.Teams
|
|||||||
this.storage = storage;
|
this.storage = storage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<DrawingsTeam> Teams
|
public IEnumerable<TournamentTeam> Teams
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var teams = new List<DrawingsTeam>();
|
var teams = new List<TournamentTeam>();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -47,17 +47,11 @@ namespace osu.Game.Screens.Tournament.Teams
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
string flagName = split[0].Trim();
|
teams.Add(new TournamentTeam
|
||||||
string teamName = split[1].Trim();
|
|
||||||
|
|
||||||
string acronym = split.Length >= 3 ? split[2].Trim() : teamName;
|
|
||||||
acronym = acronym.Substring(0, Math.Min(3, acronym.Length));
|
|
||||||
|
|
||||||
teams.Add(new DrawingsTeam
|
|
||||||
{
|
{
|
||||||
FlagName = flagName,
|
FlagName = split[0].Trim(),
|
||||||
FullName = teamName,
|
FullName = split[1].Trim(),
|
||||||
Acronym = acronym
|
Acronym = split.Length >= 3 ? split[2].Trim() : null
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,16 +1,16 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Tournament.Components
|
namespace osu.Game.Tournament.Screens.Drawings.Components
|
||||||
{
|
{
|
||||||
public class VisualiserContainer : Container
|
public class VisualiserContainer : Container
|
||||||
{
|
{
|
@ -9,23 +9,23 @@ using System.Threading.Tasks;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
|
using osu.Framework.IO.Stores;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
using osu.Game.Screens;
|
||||||
using osu.Game.Screens.Backgrounds;
|
using osu.Game.Screens.Backgrounds;
|
||||||
using osu.Game.Screens.Tournament.Components;
|
using osu.Game.Tournament.Screens.Drawings.Components;
|
||||||
using osu.Game.Screens.Tournament.Teams;
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.IO.Stores;
|
|
||||||
using osu.Framework.Graphics.Shapes;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Tournament
|
namespace osu.Game.Tournament.Screens.Drawings
|
||||||
{
|
{
|
||||||
public class Drawings : OsuScreen
|
public class DrawingsScreen : OsuScreen
|
||||||
{
|
{
|
||||||
private const string results_filename = "drawings_results.txt";
|
private const string results_filename = "drawings_results.txt";
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
private GroupContainer groupsContainer;
|
private GroupContainer groupsContainer;
|
||||||
private OsuSpriteText fullTeamNameText;
|
private OsuSpriteText fullTeamNameText;
|
||||||
|
|
||||||
private readonly List<DrawingsTeam> allTeams = new List<DrawingsTeam>();
|
private readonly List<TournamentTeam> allTeams = new List<TournamentTeam>();
|
||||||
|
|
||||||
private DrawingsConfigManager drawingsConfig;
|
private DrawingsConfigManager drawingsConfig;
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
reset(true);
|
reset(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onTeamSelected(DrawingsTeam team)
|
private void onTeamSelected(TournamentTeam team)
|
||||||
{
|
{
|
||||||
groupsContainer.AddTeam(team);
|
groupsContainer.AddTeam(team);
|
||||||
|
|
||||||
@ -290,7 +290,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
teamsContainer.ClearTeams();
|
teamsContainer.ClearTeams();
|
||||||
allTeams.Clear();
|
allTeams.Clear();
|
||||||
|
|
||||||
foreach (DrawingsTeam t in TeamList.Teams)
|
foreach (TournamentTeam t in TeamList.Teams)
|
||||||
{
|
{
|
||||||
if (groupsContainer.ContainsTeam(t.FullName))
|
if (groupsContainer.ContainsTeam(t.FullName))
|
||||||
continue;
|
continue;
|
||||||
@ -327,7 +327,7 @@ namespace osu.Game.Screens.Tournament
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// ReSharper disable once AccessToModifiedClosure
|
// ReSharper disable once AccessToModifiedClosure
|
||||||
DrawingsTeam teamToAdd = allTeams.FirstOrDefault(t => t.FullName == line);
|
TournamentTeam teamToAdd = allTeams.FirstOrDefault(t => t.FullName == line);
|
||||||
|
|
||||||
if (teamToAdd == null)
|
if (teamToAdd == null)
|
||||||
continue;
|
continue;
|
13
osu.Game.Tournament/osu.Game.Tournament.csproj
Normal file
13
osu.Game.Tournament/osu.Game.Tournament.csproj
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<Import Project="..\osu.Game.props" />
|
||||||
|
<PropertyGroup Label="Project">
|
||||||
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<Description>tools for tournaments.</Description>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup Label="Project References">
|
||||||
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
@ -3,11 +3,8 @@
|
|||||||
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using OpenTK.Input;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Input.EventArgs;
|
|
||||||
using osu.Framework.Input.States;
|
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
@ -18,7 +15,6 @@ using osu.Game.Screens.Direct;
|
|||||||
using osu.Game.Screens.Edit;
|
using osu.Game.Screens.Edit;
|
||||||
using osu.Game.Screens.Multi;
|
using osu.Game.Screens.Multi;
|
||||||
using osu.Game.Screens.Select;
|
using osu.Game.Screens.Select;
|
||||||
using osu.Game.Screens.Tournament;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Menu
|
namespace osu.Game.Screens.Menu
|
||||||
{
|
{
|
||||||
@ -199,16 +195,5 @@ namespace osu.Game.Screens.Menu
|
|||||||
Content.FadeOut(3000);
|
Content.FadeOut(3000);
|
||||||
return base.OnExiting(next);
|
return base.OnExiting(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
|
||||||
{
|
|
||||||
if (!args.Repeat && state.Keyboard.ControlPressed && state.Keyboard.ShiftPressed && args.Key == Key.D)
|
|
||||||
{
|
|
||||||
Push(new Drawings());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return base.OnKeyDown(state, args);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
{
|
{
|
||||||
beatmap.SetAudioManager(audioManager);
|
beatmap.SetAudioManager(audioManager);
|
||||||
|
|
||||||
Ruleset.Value = rulesets.AvailableRulesets.First();
|
Ruleset.Value = rulesets.AvailableRulesets.FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
|
12
osu.sln
12
osu.sln
@ -27,6 +27,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Taiko.Tes
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Osu.Tests", "osu.Game.Rulesets.Osu.Tests\osu.Game.Rulesets.Osu.Tests.csproj", "{6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "osu.Game.Rulesets.Osu.Tests", "osu.Game.Rulesets.Osu.Tests\osu.Game.Rulesets.Osu.Tests.csproj", "{6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tournament", "osu.Game.Tournament\osu.Game.Tournament.csproj", "{5672CA4D-1B37-425B-A118-A8DA26E78938}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "osu.Game.Tournament.Tests", "osu.Game.Tournament.Tests\osu.Game.Tournament.Tests.csproj", "{5789E78D-38F9-4072-AB7B-978F34B2C17F}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -81,6 +85,14 @@ Global
|
|||||||
{6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Release|Any CPU.Build.0 = Release|Any CPU
|
{6A2D5D58-0261-4A75-BE84-2BE8B076B7C2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{5672CA4D-1B37-425B-A118-A8DA26E78938}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{5672CA4D-1B37-425B-A118-A8DA26E78938}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{5672CA4D-1B37-425B-A118-A8DA26E78938}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{5672CA4D-1B37-425B-A118-A8DA26E78938}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{5789E78D-38F9-4072-AB7B-978F34B2C17F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{5789E78D-38F9-4072-AB7B-978F34B2C17F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{5789E78D-38F9-4072-AB7B-978F34B2C17F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{5789E78D-38F9-4072-AB7B-978F34B2C17F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
Loading…
Reference in New Issue
Block a user