add ServicesContainer object to IApplication
This commit is contained in:
parent
eaccf9f875
commit
d6809cadb5
|
@ -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()
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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; }
|
||||
|
|
Reference in a new issue