add ServicesContainer object to IApplication

This commit is contained in:
Gered 2013-08-22 18:34:52 -04:00
parent eaccf9f875
commit d6809cadb5
3 changed files with 10 additions and 0 deletions

View file

@ -20,6 +20,7 @@ namespace Blarg.GameFramework
public abstract PlatformType Type { get; }
public abstract ILogger Logger { get; }
public ServiceContainer Services { get; private set; }
public abstract IFileSystem FileSystem { get; }
public abstract IKeyboard Keyboard { get; }
public abstract IMouse Mouse { get; }
@ -44,12 +45,15 @@ namespace Blarg.GameFramework
protected void OnInit()
{
Logger.Info(LOG_TAG, "Initializing application objects.");
Services = new ServiceContainer();
GraphicsDevice = new GraphicsDevice();
}
protected void OnShutdown()
{
Logger.Info(LOG_TAG, "Shutting down.");
Services.Dispose();
Services = null;
}
protected void OnAppGainFocus()

View file

@ -13,6 +13,7 @@ namespace Blarg.GameFramework
PlatformType Type { get; }
ILogger Logger { get; }
ServiceContainer Services { get; }
IFileSystem FileSystem { get; }
IKeyboard Keyboard { get; }
IMouse Mouse { get; }

View file

@ -40,6 +40,11 @@ namespace Blarg.GameFramework
get { return Application.Logger; }
}
public static ServiceContainer Services
{
get { return Application.Services; }
}
public static IFileSystem FileSystem
{
get { return Application.FileSystem; }