mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-08-05 10:10:12 +08:00
refactor(UXAssist): harden ModFeatureRegistry
This commit is contained in:
@@ -2,12 +2,27 @@ using System;
|
||||
|
||||
namespace UXAssist.Common.ModFeatures;
|
||||
|
||||
/// <summary>
|
||||
/// Marks a static class as a mod feature so that <see cref="ModFeatureRegistry"/> can discover it.
|
||||
/// Lifecycle methods (<c>Init</c>, <c>Start</c>, <c>Uninit</c>, <c>OnInputUpdate</c>, <c>OnUpdate</c>) are optional.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
|
||||
public sealed class ModFeatureAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Optional display name of the feature.
|
||||
/// </summary>
|
||||
public string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Execution order among discovered static features. Lower values run first.
|
||||
/// </summary>
|
||||
public int Order { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ModFeatureAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="name">Optional display name of the feature.</param>
|
||||
public ModFeatureAttribute(string name = null)
|
||||
{
|
||||
Name = name;
|
||||
|
||||
Reference in New Issue
Block a user