mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Convert everything to DI pattern
This commit is contained in:
@ -16,6 +16,7 @@ using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Online.Chat.Display;
|
||||
using OpenTK;
|
||||
using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
@ -34,11 +35,10 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
private ChannelDisplay channelDisplay;
|
||||
|
||||
protected override void Load(BaseGame game)
|
||||
[Initializer]
|
||||
private void Load(APIAccess api)
|
||||
{
|
||||
base.Load(game);
|
||||
|
||||
api = ((OsuGameBase)game).API;
|
||||
this.api = api;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
|
@ -9,6 +9,7 @@ using osu.Game.Beatmaps.Objects;
|
||||
using osu.Game.Beatmaps.Objects.Osu;
|
||||
using osu.Game.Beatmaps.Objects.Osu.Drawable;
|
||||
using OpenTK;
|
||||
using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
@ -20,10 +21,9 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
protected override IFrameBasedClock Clock => ourClock;
|
||||
|
||||
protected override void Load(BaseGame game)
|
||||
[Initializer]
|
||||
private void Load()
|
||||
{
|
||||
base.Load(game);
|
||||
|
||||
var swClock = new StopwatchClock(true) { Rate = 1 };
|
||||
ourClock = new FramedClock(swClock);
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ using osu.Game.Beatmaps.Objects.Osu;
|
||||
using osu.Game.GameModes.Play;
|
||||
using OpenTK;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
|
||||
namespace osu.Desktop.VisualTests.Tests
|
||||
{
|
||||
@ -25,12 +26,10 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
protected override IFrameBasedClock Clock => localClock;
|
||||
|
||||
private BaseGame game;
|
||||
|
||||
protected override void Load(BaseGame game)
|
||||
[Initializer]
|
||||
private void Load()
|
||||
{
|
||||
base.Load(game);
|
||||
this.game = game;
|
||||
// TODO: Do we even need this here?
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
@ -64,9 +63,10 @@ namespace osu.Desktop.VisualTests.Tests
|
||||
|
||||
decoder.Process(b);
|
||||
|
||||
var player = game.Dependencies.Get<Player>();
|
||||
player.Beatmap = new WorkingBeatmap(b);
|
||||
Add(player);
|
||||
Add(new Player
|
||||
{
|
||||
Beatmap = new WorkingBeatmap(b)
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
|
Reference in New Issue
Block a user