mirror of
https://github.com/ppy/osu.git
synced 2025-02-24 20:33:32 +08:00
Move control of databases into osu-framework
This commit is contained in:
parent
bf644c2fc6
commit
48ced4a79e
@ -12,8 +12,8 @@ namespace osu.Framework.VisualTests
|
|||||||
[STAThread]
|
[STAThread]
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
BasicGameHost host = Host.GetSuitableHost(@"visual-tests");
|
BasicGameHost host = Host.GetSuitableHost("osu-tests");
|
||||||
host.Add(new VisualTestGame());
|
host.Load(new VisualTestGame());
|
||||||
host.Run();
|
host.Run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using osu.Framework.OS;
|
||||||
using SQLite;
|
using SQLite;
|
||||||
|
|
||||||
namespace osu.Game.Database
|
namespace osu.Game.Database
|
||||||
@ -7,11 +8,11 @@ namespace osu.Game.Database
|
|||||||
{
|
{
|
||||||
private static SQLiteConnection Connection { get; set; }
|
private static SQLiteConnection Connection { get; set; }
|
||||||
|
|
||||||
public BeatmapDatabase()
|
public BeatmapDatabase(BasicStorage storage)
|
||||||
{
|
{
|
||||||
if (Connection == null)
|
if (Connection == null)
|
||||||
{
|
{
|
||||||
Connection = new SQLiteConnection("beatmap.db");
|
Connection = storage.GetDb("beatmaps");
|
||||||
Connection.CreateTable<BeatmapMetadata>();
|
Connection.CreateTable<BeatmapMetadata>();
|
||||||
Connection.CreateTable<BeatmapSet>();
|
Connection.CreateTable<BeatmapSet>();
|
||||||
Connection.CreateTable<Beatmap>();
|
Connection.CreateTable<Beatmap>();
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game
|
|||||||
public class OsuGameBase : Framework.Game
|
public class OsuGameBase : Framework.Game
|
||||||
{
|
{
|
||||||
internal OsuConfigManager Config = new OsuConfigManager();
|
internal OsuConfigManager Config = new OsuConfigManager();
|
||||||
internal BeatmapDatabase Beatmaps = new BeatmapDatabase();
|
internal BeatmapDatabase Beatmaps { get; private set; }
|
||||||
|
|
||||||
protected override string MainResourceFile => @"osu.Game.Resources.dll";
|
protected override string MainResourceFile => @"osu.Game.Resources.dll";
|
||||||
|
|
||||||
@ -33,6 +33,8 @@ namespace osu.Game
|
|||||||
{
|
{
|
||||||
base.Load();
|
base.Load();
|
||||||
|
|
||||||
|
Beatmaps = new BeatmapDatabase(Host.Storage);
|
||||||
|
|
||||||
//this completely overrides the framework default. will need to change once we make a proper FontStore.
|
//this completely overrides the framework default. will need to change once we make a proper FontStore.
|
||||||
Fonts = new TextureStore() { ScaleAdjust = 0.01f };
|
Fonts = new TextureStore() { ScaleAdjust = 0.01f };
|
||||||
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Regular"));
|
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Regular"));
|
||||||
|
Loading…
Reference in New Issue
Block a user