Deukhoofd 377c1a1c68
All checks were successful
Build / Build (push) Successful in 48s
Implements critical capture, tweaks for integration tests.
2025-05-18 17:07:46 +02:00

58 lines
1.7 KiB
C#

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<TConfiguration> : IPlugin where TConfiguration : IPluginConfiguration
{
public TConfiguration Configuration { get; }
/// <inheritdoc cref="Plugin{TConfiguration}"/>
protected Plugin(TConfiguration configuration)
{
Configuration = configuration;
}
/// <summary>
/// The name of the plugin. Mostly used for debugging purposes.
/// </summary>
public abstract 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>
public abstract uint LoadOrder { get; }
/// <summary>
/// Run the registration of the plugin when we're building the library.
/// </summary>
public abstract void Register(ScriptRegistry registry);
}
/// <summary>
/// Base class for plugin configuration.
/// </summary>
public interface IPluginConfiguration;