Move SQLite connections out of database classes; make abstract Database.

This commit is contained in:
Dean Herbert
2017-04-17 14:37:52 +09:00
parent ce12cc20bd
commit 83b083ce64
8 changed files with 105 additions and 77 deletions

View File

@ -18,6 +18,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Cursor;
using osu.Game.Graphics.Processing;
using osu.Game.Online.API;
using SQLite.Net;
namespace osu.Game
{
@ -80,8 +81,11 @@ namespace osu.Game
{
Dependencies.Cache(this);
Dependencies.Cache(LocalConfig);
Dependencies.Cache(BeatmapDatabase = new BeatmapDatabase(Host.Storage, Host));
Dependencies.Cache(ScoreDatabase = new ScoreDatabase(Host.Storage, Host, BeatmapDatabase));
SQLiteConnection connection = Host.Storage.GetDatabase(@"client");
Dependencies.Cache(BeatmapDatabase = new BeatmapDatabase(Host.Storage, connection, Host));
Dependencies.Cache(ScoreDatabase = new ScoreDatabase(Host.Storage, connection, Host, BeatmapDatabase));
Dependencies.Cache(new OsuColour());
//this completely overrides the framework default. will need to change once we make a proper FontStore.