Change order of dependency caching to promote use of locals

This commit is contained in:
Dean Herbert 2020-09-15 15:00:04 +09:00
parent 914785ce17
commit 3242b10187
2 changed files with 10 additions and 9 deletions

View File

@ -35,6 +35,11 @@ public class TestSceneManageCollectionsDialog : OsuManualInputManagerTestScene
[BackgroundDependencyLoader]
private void load(GameHost host)
{
Dependencies.Cache(rulesets = new RulesetStore(ContextFactory));
Dependencies.Cache(beatmapManager = new BeatmapManager(LocalStorage, ContextFactory, rulesets, null, Audio, host, Beatmap.Default));
beatmapManager.Import(TestResources.GetTestBeatmapForImport()).Wait();
base.Content.AddRange(new Drawable[]
{
manager = new CollectionManager(LocalStorage),
@ -44,11 +49,6 @@ private void load(GameHost host)
Dependencies.Cache(manager);
Dependencies.Cache(dialogOverlay);
Dependencies.Cache(rulesets = new RulesetStore(ContextFactory));
Dependencies.Cache(beatmapManager = new BeatmapManager(LocalStorage, ContextFactory, rulesets, null, Audio, host, Beatmap.Default));
beatmapManager.Import(TestResources.GetTestBeatmapForImport()).Wait();
}
[SetUp]

View File

@ -35,6 +35,11 @@ public class TestSceneFilterControl : OsuManualInputManagerTestScene
[BackgroundDependencyLoader]
private void load(GameHost host)
{
Dependencies.Cache(rulesets = new RulesetStore(ContextFactory));
Dependencies.Cache(beatmapManager = new BeatmapManager(LocalStorage, ContextFactory, rulesets, null, Audio, host, Beatmap.Default));
beatmapManager.Import(TestResources.GetTestBeatmapForImport()).Wait();
base.Content.AddRange(new Drawable[]
{
collectionManager = new CollectionManager(LocalStorage),
@ -42,10 +47,6 @@ private void load(GameHost host)
});
Dependencies.Cache(collectionManager);
Dependencies.Cache(rulesets = new RulesetStore(ContextFactory));
Dependencies.Cache(beatmapManager = new BeatmapManager(LocalStorage, ContextFactory, rulesets, null, Audio, host, Beatmap.Default));
beatmapManager.Import(TestResources.GetTestBeatmapForImport()).Wait();
}
[SetUp]