Introduce dependency injection

This commit is contained in:
Drew DeVault
2016-11-04 18:06:58 -04:00
parent 788c11de10
commit 19fd6fe249
5 changed files with 17 additions and 11 deletions

View File

@ -23,7 +23,6 @@ namespace osu.Game
public class OsuGameBase : BaseGame
{
internal OsuConfigManager Config;
public BeatmapDatabase Beatmaps { get; private set; }
protected override string MainResourceFile => @"osu.Game.Resources.dll";
@ -57,8 +56,11 @@ namespace osu.Game
{
base.Load(game);
Dependencies.Cache(this);
Dependencies.Cache<OsuConfigManager>();
Dependencies.Cache(new BeatmapDatabase(Host.Storage, Host));
OszArchiveReader.Register();
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 };