Add overload for creating dynamic library from earlier loaded results
Build / Build (push) Successful in 10m14s
Build / Build (push) Successful in 10m14s
This commit is contained in:
1 file changed
+11
-4
@@ -68,15 +68,22 @@ public class DynamicLibraryImpl : IDynamicLibrary
|
|||||||
/// Initializes a new instance of the <see cref="DynamicLibraryImpl"/> class, with the given
|
/// Initializes a new instance of the <see cref="DynamicLibraryImpl"/> class, with the given
|
||||||
/// plugins and static library.
|
/// plugins and static library.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[PublicAPI]
|
||||||
public static IDynamicLibrary Create(IEnumerable<IPlugin> plugins, PluginEnvironmentHelpers helpers)
|
public static IDynamicLibrary Create(IEnumerable<IPlugin> plugins, PluginEnvironmentHelpers helpers)
|
||||||
{
|
{
|
||||||
var load = LibraryLoader.LoadPlugins(plugins, helpers);
|
var load = LibraryLoader.LoadPlugins(plugins, helpers);
|
||||||
|
return Create(load);
|
||||||
return new DynamicLibraryImpl(load.StaticLibrary, load.Registry.BattleStatCalculator!,
|
|
||||||
load.Registry.DamageCalculator!, load.Registry.MiscLibrary!, load.Registry.CaptureLibrary!, load.Resolver,
|
|
||||||
load.Registry.ExplicitAIHandlers, load.Registry.ExperienceGainCalculator!);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="DynamicLibraryImpl"/> class, with an earlier loaded loadresult.
|
||||||
|
/// </summary>
|
||||||
|
[PublicAPI]
|
||||||
|
public static IDynamicLibrary Create(LibraryLoader.LoadResult load) =>
|
||||||
|
new DynamicLibraryImpl(load.StaticLibrary, load.Registry.BattleStatCalculator!, load.Registry.DamageCalculator!,
|
||||||
|
load.Registry.MiscLibrary!, load.Registry.CaptureLibrary!, load.Resolver, load.Registry.ExplicitAIHandlers,
|
||||||
|
load.Registry.ExperienceGainCalculator!);
|
||||||
|
|
||||||
private DynamicLibraryImpl(IStaticLibrary staticLibrary, IBattleStatCalculator statCalculator,
|
private DynamicLibraryImpl(IStaticLibrary staticLibrary, IBattleStatCalculator statCalculator,
|
||||||
IDamageCalculator damageCalculator, IMiscLibrary miscLibrary, ICaptureLibrary captureLibrary,
|
IDamageCalculator damageCalculator, IMiscLibrary miscLibrary, ICaptureLibrary captureLibrary,
|
||||||
ScriptResolver scriptResolver, IReadOnlyExplicitAIHandlers explicitAIHandlers,
|
ScriptResolver scriptResolver, IReadOnlyExplicitAIHandlers explicitAIHandlers,
|
||||||
|
|||||||
Reference in new issue
Block a user