Refactor plugin loading API
Build / Build (push) Successful in 1m0s

This commit is contained in:
Deukhoofd committed 2026-11-17 21:08:52 +01:00
1 parent 8254cd8ee3
commit dc367d4d05
6 files changed
+33 -12

No files matched your search

+11 -3
View File
@@ -79,10 +79,18 @@ public class DynamicLibraryImpl : IDynamicLibrary
/// Initializes a new instance of the <see cref="DynamicLibraryImpl"/> class, with an earlier loaded loadresult.
/// </summary>
[PublicAPI]
public static IDynamicLibrary Create(LibraryLoader.LoadResult load) =>
public static IDynamicLibrary Create(LibraryLoader.LoadResult load) => Create(load, load.Helpers);
/// <summary>
/// Initializes a new instance of the <see cref="DynamicLibraryImpl"/> class, with an earlier loaded loadresult,
/// and its own environment helpers. The registration of the plugins is shared; the misc library and the
/// evolution library are created for these helpers.
/// </summary>
[PublicAPI]
public static IDynamicLibrary Create(LibraryLoader.LoadResult load, PluginEnvironmentHelpers helpers) =>
new DynamicLibraryImpl(load.StaticLibrary, load.Registry.BattleStatCalculator!, load.Registry.DamageCalculator!,
load.Registry.MiscLibrary!, load.Registry.CaptureLibrary!, load.Resolver, load.Registry.ExplicitAIHandlers,
load.Registry.ExperienceGainCalculator!);
load.Registry.MiscLibraryFactory!(helpers), load.Registry.CaptureLibrary!, load.Resolver,
load.Registry.ExplicitAIHandlers, load.Registry.ExperienceGainCalculator!);
private DynamicLibraryImpl(IStaticLibrary staticLibrary, IBattleStatCalculator statCalculator,
IDamageCalculator damageCalculator, IMiscLibrary miscLibrary, ICaptureLibrary captureLibrary,