Move control of databases into osu-framework

This commit is contained in:
Drew DeVault 2016-10-04 13:35:40 -04:00
parent 2d810f72fa
commit 72c4a26aea
2 changed files with 6 additions and 3 deletions

View File

@ -1,4 +1,5 @@
using System;
using osu.Framework.OS;
using SQLite;
namespace osu.Game.Database
@ -7,11 +8,11 @@ namespace osu.Game.Database
{
private static SQLiteConnection Connection { get; set; }
public BeatmapDatabase()
public BeatmapDatabase(BasicStorage storage)
{
if (Connection == null)
{
Connection = new SQLiteConnection("beatmap.db");
Connection = storage.GetDb("beatmaps");
Connection.CreateTable<BeatmapMetadata>();
Connection.CreateTable<BeatmapSet>();
Connection.CreateTable<Beatmap>();

View File

@ -17,7 +17,7 @@ namespace osu.Game
public class OsuGameBase : BaseGame
{
internal OsuConfigManager Config = new OsuConfigManager();
internal BeatmapDatabase Beatmaps = new BeatmapDatabase();
internal BeatmapDatabase Beatmaps { get; private set; }
protected override string MainResourceFile => @"osu.Game.Resources.dll";
@ -34,6 +34,8 @@ namespace osu.Game
{
base.Load(game);
Beatmaps = new BeatmapDatabase(Host.Storage);
//this completely overrides the framework default. will need to change once we make a proper FontStore.
Fonts = new TextureStore() { ScaleAdjust = 0.01f };
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Regular"));