Implementation of Pokeballs
This commit is contained in:
@@ -32,6 +32,11 @@ public interface IDynamicLibrary
|
||||
/// </summary>
|
||||
IMiscLibrary MiscLibrary { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The capture library deals with the calculation of the capture rate of a Pokémon.
|
||||
/// </summary>
|
||||
ICaptureLibrary CaptureLibrary { get; }
|
||||
|
||||
/// <summary>
|
||||
/// A holder of the script types that can be resolved by this library.
|
||||
/// </summary>
|
||||
@@ -58,19 +63,22 @@ public class DynamicLibraryImpl : IDynamicLibrary
|
||||
throw new InvalidOperationException("Stat calculator not found in plugins.");
|
||||
if (registry.MiscLibrary is null)
|
||||
throw new InvalidOperationException("Misc library not found in plugins.");
|
||||
if (registry.CaptureLibrary is null)
|
||||
throw new InvalidOperationException("Capture library not found in plugins.");
|
||||
var scriptResolver = new ScriptResolver(registry.ScriptTypes, registry.ItemScriptTypes);
|
||||
return new DynamicLibraryImpl(staticLibrary, registry.BattleStatCalculator,
|
||||
registry.DamageCalculator, registry.MiscLibrary, scriptResolver);
|
||||
registry.DamageCalculator, registry.MiscLibrary, registry.CaptureLibrary, scriptResolver);
|
||||
}
|
||||
|
||||
private DynamicLibraryImpl(IStaticLibrary staticLibrary, IBattleStatCalculator statCalculator,
|
||||
IDamageCalculator damageCalculator, IMiscLibrary miscLibrary, ScriptResolver scriptResolver)
|
||||
IDamageCalculator damageCalculator, IMiscLibrary miscLibrary, ICaptureLibrary captureLibrary, ScriptResolver scriptResolver)
|
||||
{
|
||||
StaticLibrary = staticLibrary;
|
||||
StatCalculator = statCalculator;
|
||||
DamageCalculator = damageCalculator;
|
||||
MiscLibrary = miscLibrary;
|
||||
ScriptResolver = scriptResolver;
|
||||
CaptureLibrary = captureLibrary;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -84,7 +92,10 @@ public class DynamicLibraryImpl : IDynamicLibrary
|
||||
|
||||
/// <inheritdoc />
|
||||
public IMiscLibrary MiscLibrary { get; }
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public ICaptureLibrary CaptureLibrary { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public ScriptResolver ScriptResolver { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user