From 33ef55df88ac1365060264600481afad0d728043 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 27 Oct 2016 17:34:43 +0900 Subject: [PATCH] Allow BeatmapDatabase to be constructed without a host. --- osu.Game/Database/BeatmapDatabase.cs | 9 +++++---- osu.Game/OsuGameBase.cs | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/osu.Game/Database/BeatmapDatabase.cs b/osu.Game/Database/BeatmapDatabase.cs index 896daf100e..1b55b0eeaf 100644 --- a/osu.Game/Database/BeatmapDatabase.cs +++ b/osu.Game/Database/BeatmapDatabase.cs @@ -17,17 +17,18 @@ namespace osu.Game.Database { public class BeatmapDatabase { - private static SQLiteConnection connection { get; set; } + private SQLiteConnection connection { get; set; } private BasicStorage storage; public event Action BeatmapSetAdded; private BeatmapImporter ipc; - public BeatmapDatabase(BasicGameHost host) + public BeatmapDatabase(BasicStorage storage, BasicGameHost importHost = null) { - this.storage = host.Storage; + this.storage = storage; - ipc = new BeatmapImporter(host, this); + if (importHost != null) + ipc = new BeatmapImporter(importHost, this); if (connection == null) { diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 96b56f1d1b..4df5683493 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -48,7 +48,7 @@ namespace osu.Game base.Load(game); OszArchiveReader.Register(); - Beatmaps = new BeatmapDatabase(Host); + Beatmaps = new BeatmapDatabase(Host.Storage, Host); //this completely overrides the framework default. will need to change once we make a proper FontStore. Fonts = new TextureStore() { ScaleAdjust = 0.01f };