using JetBrains.Annotations; namespace PkmnLib.Dynamic.ScriptHandling.Registry; public interface IPlugin { /// /// The name of the plugin. Mostly used for debugging purposes. /// string Name { get; } /// /// When the plugin should be loaded. Lower values are loaded first. /// 0 should be reserved for the core battle scripts. /// uint LoadOrder { get; } /// /// Run the registration of the plugin when we're building the library. /// void Register(ScriptRegistry registry); } /// /// A plugin is a way to register scripts and other dynamic components to the script registry. /// [UsedImplicitly(ImplicitUseTargetFlags.WithInheritors)] public abstract class Plugin : IPlugin where TConfiguration : IPluginConfiguration { public TConfiguration Configuration { get; } /// protected Plugin(TConfiguration configuration) { Configuration = configuration; } /// /// The name of the plugin. Mostly used for debugging purposes. /// public abstract string Name { get; } /// /// When the plugin should be loaded. Lower values are loaded first. /// 0 should be reserved for the core battle scripts. /// public abstract uint LoadOrder { get; } /// /// Run the registration of the plugin when we're building the library. /// public abstract void Register(ScriptRegistry registry); } /// /// Base class for plugin configuration. /// public interface IPluginConfiguration;