Class EngineManager
Manages the lifecycle and dependencies of game engines.
public class EngineManager : TypeMapManager<IEngine, EngineManager>, IManager<IEngine, EngineManager>, IManager, IPluginComponent, IManageable<PluginComponentsManager>, IManageable
- Inheritance
-
EngineManager
- Implements
- Inherited Members
- Extension Methods
Properties
AllowAutoLoad
Should we allot auto-loading of dependencies
public bool AllowAutoLoad { get; set; }
Property Value
Log
protected override Logger Log { get; }
Property Value
Methods
AddEngine<T>(IPlugin, bool)
public T? AddEngine<T>(IPlugin plugin, bool failIfExists = true) where T : IEngine
Parameters
Returns
- T
Type Parameters
T
AddEngine<T>(IPlugin, T, bool)
public void AddEngine<T>(IPlugin plugin, T engine, bool failIfExists = true) where T : IEngine
Parameters
Type Parameters
T
AddEngine<T>(bool)
public T? AddEngine<T>(bool failIfExists = true) where T : IEngine
Parameters
failIfExists
bool
Returns
- T
Type Parameters
T
AddEngine<T>(T, bool)
public void AddEngine<T>(T engine, bool failIfExists = true) where T : IEngine
Parameters
engine
TfailIfExists
bool
Type Parameters
T
CheckDependencies(IPlugin, bool)
Checks the dependencies of the engine and attempts to auto-load them if allowed.
public Map<Type, List<(Type, IManager)>> CheckDependencies(IPlugin plugin, bool logMissing = true)
Parameters
Returns
CheckRecommended(IPlugin, bool)
Checks the recommended manageables for the engine and logs any missing ones.
public Map<Type, List<(Type, IManager)>> CheckRecommended(IPlugin plugin, bool logMissing = true)
Parameters
Returns
GetEngine<T>(bool)
public T? GetEngine<T>(bool required = true) where T : IEngine
Parameters
required
bool
Returns
- T
Type Parameters
T
GetMissingManageables(IPlugin, IEngine, List<Dependency>)
Gets the missing manageable dependencies for a given engine.
public List<(Type, IManager)> GetMissingManageables(IPlugin plugin, IEngine engine, List<Dependency> dependencies)
Parameters
plugin
IPluginengine
IEnginedependencies
List<Dependency>
Returns
Ready(IPlugin)
Ready the manager with the given plugin including its manageable objects. This should be called after all other Managers have been loaded.
public override void Ready(IPlugin plugin)
Parameters
plugin
IPlugin
Reload(IPlugin, ReloadReason)
Reload the manager with the given plugin including its manageable objects. The manageable objects should be unloaded before calling their Reload method and should then be loaded after.
public override void Reload(IPlugin plugin, ReloadReason reason)
Parameters
plugin
IPluginreason
ReloadReason
RemoveEngine<T>(IPlugin)
public void RemoveEngine<T>(IPlugin plugin) where T : IEngine
Parameters
plugin
IPlugin
Type Parameters
T
TryReady(IEngine, IPlugin)
public bool TryReady(IEngine engine, IPlugin plugin)