Introduce a reference counting file store

This commit is contained in:
Dean Herbert
2017-07-26 20:22:02 +09:00
parent 5fc68aabbf
commit 898a601098
22 changed files with 361 additions and 215 deletions

View File

@ -11,7 +11,6 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.IO.Stores;
using osu.Framework.Platform;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.IO;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.Cursor;
@ -19,6 +18,7 @@ using osu.Game.Graphics.Processing;
using osu.Game.Online.API;
using SQLite.Net;
using osu.Framework.Graphics.Performance;
using osu.Game.IO;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Scoring;
@ -32,6 +32,8 @@ namespace osu.Game
protected RulesetDatabase RulesetDatabase;
protected FileDatabase FileDatabase;
protected ScoreDatabase ScoreDatabase;
protected override string MainResourceFile => @"osu.Game.Resources.dll";
@ -96,7 +98,8 @@ namespace osu.Game
SQLiteConnection connection = Host.Storage.GetDatabase(@"client");
dependencies.Cache(RulesetDatabase = new RulesetDatabase(connection));
dependencies.Cache(BeatmapStore = new BeatmapStore(Host.Storage, connection, RulesetDatabase, Host));
dependencies.Cache(FileDatabase = new FileDatabase(connection, Host.Storage));
dependencies.Cache(BeatmapStore = new BeatmapStore(Host.Storage, FileDatabase, connection, RulesetDatabase, Host));
dependencies.Cache(ScoreDatabase = new ScoreDatabase(Host.Storage, connection, Host, BeatmapStore));
dependencies.Cache(new OsuColour());
@ -131,8 +134,6 @@ namespace osu.Game
Beatmap = new NonNullableBindable<WorkingBeatmap>(defaultBeatmap);
BeatmapStore.DefaultBeatmap = defaultBeatmap;
OszArchiveReader.Register();
dependencies.Cache(API = new APIAccess
{
Username = LocalConfig.Get<string>(OsuSetting.Username),