Make ResourceManager a part of Game.
This commit is contained in:
@@ -1,8 +1,20 @@
|
||||
using Voile.Resources;
|
||||
|
||||
namespace Voile
|
||||
{
|
||||
public abstract class Game
|
||||
{
|
||||
/// <summary>
|
||||
/// The ResourceManager associated with this game.
|
||||
/// </summary>
|
||||
protected ResourceManager ResourceManager { get; private set; }
|
||||
public abstract string ResourceRoot { get; }
|
||||
public virtual string EngineConfigPath => "engine.config";
|
||||
|
||||
public Game()
|
||||
{
|
||||
ResourceManager = new ResourceManager();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts the game application.
|
||||
@@ -10,6 +22,8 @@ namespace Voile
|
||||
/// </summary>
|
||||
public void Start()
|
||||
{
|
||||
Configure();
|
||||
|
||||
Initialize();
|
||||
LoadResources();
|
||||
Ready();
|
||||
@@ -37,5 +51,10 @@ namespace Voile
|
||||
/// Called when the application quits and it's safe to clean up.
|
||||
/// </summary>
|
||||
public abstract void Shutdown();
|
||||
|
||||
private void Configure()
|
||||
{
|
||||
ResourceManager.ResourceRoot = ResourceRoot;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
|
||||
using Voile.Utils;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user