Class Engine<TConfig>
Represents a base class for engines
public abstract class Engine<TConfig> : IEngine<TConfig>, IEngine, IManageableLifecycle<EngineManager>, IManageableLifecycle, IReloadable, IManageable<EngineManager>, IManageable, IEnableable where TConfig : IEngineConfig
Type Parameters
TConfig
The type of the engine configuration.
- Inheritance
-
Engine<TConfig>
- Implements
-
IEngine<TConfig>
- Inherited Members
- Extension Methods
Constructors
Engine()
protected Engine()
Engine(TConfig)
Represents a base class for engines
protected Engine(TConfig config)
Parameters
config
TConfigThe configuration for the engine.
Properties
Config
public TConfig Config { get; }
Property Value
- TConfig
Dependencies
protected virtual List<Dependency> Dependencies { get; }
Property Value
Enabled
public virtual bool Enabled { get; }
Property Value
Recommended
protected virtual List<Recommendation> Recommended { get; }
Property Value
Methods
GetDependencies()
Gets the dependencies of the engine.
public List<Dependency> GetDependencies()
Returns
GetDependencies<TX>()
Gets the dependencies of the engine, excluding those that are assignable to the specified type.
public List<Dependency> GetDependencies<TX>()
Returns
Type Parameters
TX
GetRecommended()
Gets the recommended dependencies of the engine.
public List<Recommendation> GetRecommended()
Returns
GetRecommendedAsDependencies()
public (List<Dependency>, List<Recommendation>) GetRecommendedAsDependencies()
Returns
- (List<Dependency>, List<Recommendation>)
GetRecommended<TX>()
Gets the recommended dependencies of the engine, excluding those that are assignable to the specified type.
public List<Recommendation> GetRecommended<TX>()
Returns
Type Parameters
TX
Initialize(EngineManager, List<IPlugin>)
Initializes the lifecycle of the manager with a specific type.
public virtual void Initialize(EngineManager manager, List<IPlugin> plugins)
Parameters
manager
EngineManagerplugins
List<IPlugin>
Load(EngineManager, List<IPlugin>)
Loads the manager and its dependencies with a specific type.
public virtual void Load(EngineManager manager, List<IPlugin> plugins)
Parameters
manager
EngineManagerplugins
List<IPlugin>
OnDependencyLoaded(Type, EngineManager, List<IPlugin>)
Called when a dependency is loaded.
public virtual void OnDependencyLoaded(Type dependency, EngineManager manager, List<IPlugin> plugins)
Parameters
dependency
TypeThe type of the dependency that was loaded.
manager
EngineManagerThe engine manager that loaded the dependency.
plugins
List<IPlugin>The list of plugins that are currently loaded.
OnReload(EngineManager, ReloadReason)
Called when the engine is reloaded.
public bool OnReload(EngineManager manager, ReloadReason reason)
Parameters
manager
EngineManagerreason
ReloadReason
Returns
Ready(EngineManager, List<IPlugin>)
Prepares the manager for use with a specific type, typically after loading.
public abstract void Ready(EngineManager manager, List<IPlugin> plugins)
Parameters
manager
EngineManagerplugins
List<IPlugin>
Reload(EngineManager, List<IPlugin>, ReloadReason)
Reloads the manager and its dependencies with a specific type.
public void Reload(EngineManager manager, List<IPlugin> plugins, ReloadReason reason)
Parameters
manager
EngineManagerplugins
List<IPlugin>reason
ReloadReason
Terminate(EngineManager, List<IPlugin>)
Terminates the manager and cleans up resources with a specific type.
public virtual void Terminate(EngineManager manager, List<IPlugin> plugins)
Parameters
manager
EngineManagerplugins
List<IPlugin>
Unload(EngineManager, List<IPlugin>)
Unloads the manager and its dependencies with a specific type.
public void Unload(EngineManager manager, List<IPlugin> plugins)
Parameters
manager
EngineManagerplugins
List<IPlugin>