Allow BeatmapDatabase to be constructed without a host.

This commit is contained in:
Dean Herbert 2016-10-27 17:34:43 +09:00
parent 801e4bbb0d
commit 33ef55df88
2 changed files with 6 additions and 5 deletions

View File

@ -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<BeatmapSetInfo> 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)
{

View File

@ -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 };