Getting started with implementing an explicit AI, based on the Essentials one.
All checks were successful
Build / Build (push) Successful in 1m2s
All checks were successful
Build / Build (push) Successful in 1m2s
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using PkmnLib.Dynamic.AI.Explicit;
|
||||
using PkmnLib.Dynamic.Plugins;
|
||||
using PkmnLib.Dynamic.ScriptHandling;
|
||||
using PkmnLib.Dynamic.ScriptHandling.Registry;
|
||||
using PkmnLib.Static.Libraries;
|
||||
@@ -41,6 +43,12 @@ public interface IDynamicLibrary
|
||||
/// A holder of the script types that can be resolved by this library.
|
||||
/// </summary>
|
||||
ScriptResolver ScriptResolver { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The deterministic AI handlers provide a way to access the various handlers used by the
|
||||
/// <see cref="ExplicitAI"/> to make decisions.
|
||||
/// </summary>
|
||||
IReadOnlyExplicitAIHandlers ExplicitAIHandlers { get; }
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -55,18 +63,20 @@ public class DynamicLibraryImpl : IDynamicLibrary
|
||||
var load = LibraryLoader.LoadPlugins(plugins);
|
||||
|
||||
return new DynamicLibraryImpl(load.StaticLibrary, load.Registry.BattleStatCalculator!,
|
||||
load.Registry.DamageCalculator!, load.Registry.MiscLibrary!, load.Registry.CaptureLibrary!, load.Resolver);
|
||||
load.Registry.DamageCalculator!, load.Registry.MiscLibrary!, load.Registry.CaptureLibrary!, load.Resolver,
|
||||
load.Registry.ExplicitAIHandlers);
|
||||
}
|
||||
|
||||
private DynamicLibraryImpl(IStaticLibrary staticLibrary, IBattleStatCalculator statCalculator,
|
||||
IDamageCalculator damageCalculator, IMiscLibrary miscLibrary, ICaptureLibrary captureLibrary,
|
||||
ScriptResolver scriptResolver)
|
||||
ScriptResolver scriptResolver, IReadOnlyExplicitAIHandlers explicitAIHandlers)
|
||||
{
|
||||
StaticLibrary = staticLibrary;
|
||||
StatCalculator = statCalculator;
|
||||
DamageCalculator = damageCalculator;
|
||||
MiscLibrary = miscLibrary;
|
||||
ScriptResolver = scriptResolver;
|
||||
ExplicitAIHandlers = explicitAIHandlers;
|
||||
CaptureLibrary = captureLibrary;
|
||||
}
|
||||
|
||||
@@ -87,4 +97,7 @@ public class DynamicLibraryImpl : IDynamicLibrary
|
||||
|
||||
/// <inheritdoc />
|
||||
public ScriptResolver ScriptResolver { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IReadOnlyExplicitAIHandlers ExplicitAIHandlers { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user