Implements critical capture, tweaks for integration tests.
All checks were successful
Build / Build (push) Successful in 48s
All checks were successful
Build / Build (push) Successful in 48s
This commit is contained in:
@@ -2,20 +2,37 @@ using JetBrains.Annotations;
|
||||
|
||||
namespace PkmnLib.Dynamic.ScriptHandling.Registry;
|
||||
|
||||
public interface IPlugin
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the plugin. Mostly used for debugging purposes.
|
||||
/// </summary>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// When the plugin should be loaded. Lower values are loaded first.
|
||||
/// 0 should be reserved for the core battle scripts.
|
||||
/// </summary>
|
||||
uint LoadOrder { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Run the registration of the plugin when we're building the library.
|
||||
/// </summary>
|
||||
void Register(ScriptRegistry registry);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A plugin is a way to register scripts and other dynamic components to the script registry.
|
||||
/// </summary>
|
||||
[UsedImplicitly(ImplicitUseTargetFlags.WithInheritors)]
|
||||
public abstract class Plugin
|
||||
public abstract class Plugin<TConfiguration> : IPlugin where TConfiguration : IPluginConfiguration
|
||||
{
|
||||
/// <inheritdoc cref="Plugin"/>
|
||||
protected Plugin()
|
||||
{
|
||||
}
|
||||
public TConfiguration Configuration { get; }
|
||||
|
||||
/// <inheritdoc cref="Plugin"/>
|
||||
protected Plugin(PluginConfiguration configuration)
|
||||
/// <inheritdoc cref="Plugin{TConfiguration}"/>
|
||||
protected Plugin(TConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -38,4 +55,4 @@ public abstract class Plugin
|
||||
/// <summary>
|
||||
/// Base class for plugin configuration.
|
||||
/// </summary>
|
||||
public abstract class PluginConfiguration;
|
||||
public interface IPluginConfiguration;
|
||||
Reference in New Issue
Block a user