mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 03:25:11 +08:00
Make Player abstract and introduce SoloPlayer
This commit is contained in:
parent
5267fb74c4
commit
6cb14e91c9
@ -58,7 +58,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
||||
public void TestPerformAtSongSelectFromPlayerLoader()
|
||||
{
|
||||
PushAndConfirm(() => new PlaySongSelect());
|
||||
PushAndConfirm(() => new PlayerLoader(() => new Player()));
|
||||
PushAndConfirm(() => new PlayerLoader(() => new SoloPlayer()));
|
||||
|
||||
AddStep("try to perform", () => Game.PerformFromScreen(_ => actionPerformed = true, new[] { typeof(PlaySongSelect) }));
|
||||
AddUntilStep("returned to song select", () => Game.ScreenStack.CurrentScreen is PlaySongSelect);
|
||||
@ -69,7 +69,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
||||
public void TestPerformAtMenuFromPlayerLoader()
|
||||
{
|
||||
PushAndConfirm(() => new PlaySongSelect());
|
||||
PushAndConfirm(() => new PlayerLoader(() => new Player()));
|
||||
PushAndConfirm(() => new PlayerLoader(() => new SoloPlayer()));
|
||||
|
||||
AddStep("try to perform", () => Game.PerformFromScreen(_ => actionPerformed = true));
|
||||
AddUntilStep("returned to song select", () => Game.ScreenStack.CurrentScreen is MainMenu);
|
||||
|
@ -39,7 +39,7 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
[Cached]
|
||||
[Cached(typeof(ISamplePlaybackDisabler))]
|
||||
public class Player : ScreenWithBeatmapBackground, ISamplePlaybackDisabler
|
||||
public abstract class Player : ScreenWithBeatmapBackground, ISamplePlaybackDisabler
|
||||
{
|
||||
/// <summary>
|
||||
/// The delay upon completion of the beatmap before displaying the results screen.
|
||||
@ -135,7 +135,7 @@ namespace osu.Game.Screens.Play
|
||||
/// <summary>
|
||||
/// Create a new player instance.
|
||||
/// </summary>
|
||||
public Player(PlayerConfiguration configuration = null)
|
||||
protected Player(PlayerConfiguration configuration = null)
|
||||
{
|
||||
Configuration = configuration ?? new PlayerConfiguration();
|
||||
}
|
||||
|
9
osu.Game/Screens/Play/SoloPlayer.cs
Normal file
9
osu.Game/Screens/Play/SoloPlayer.cs
Normal file
@ -0,0 +1,9 @@
|
||||
// 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.
|
||||
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
public class SoloPlayer : Player
|
||||
{
|
||||
}
|
||||
}
|
@ -106,7 +106,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
SampleConfirm?.Play();
|
||||
|
||||
this.Push(player = new PlayerLoader(() => new Player()));
|
||||
this.Push(player = new PlayerLoader(() => new SoloPlayer()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user