mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 将 GFramework.Godot.SourceGenerators 项目的目标框架从 netstandard2.1 更改为 netstandard2.0 - 将 GFramework.SourceGenerators.Abstractions 项目的目标框架从 netstandard2.1 更改为 netstandard2.0 - 将 GFramework.SourceGenerators 项目的目标框架从 netstandard2.1 更改为 netstandard2.0 - 将 GFramework.SourceGenerators.Common 项目的目标框架从 netstandard2.1 更改为 netstandard2.0 - 从 GFramework.SourceGenerators 项目中移除对 GFramework.Core.Abstractions 的引用 - 从 GFramework.SourceGenerators.Abstractions 项目中移除对 GFramework.Core.Abstractions 的引用 - 更新 PriorityGenerator 中的语法检查逻辑,使用 Any 替代 All 进行 partial 关键字检查 - 更新 PriorityAttribute 文档注释中的 cref 格式为 c 标签
35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
namespace GFramework.SourceGenerators.Abstractions.Bases;
|
|
|
|
/// <summary>
|
|
/// 标记类的优先级,自动生成 <c>GFramework.Core.Abstractions.Bases.IPrioritized</c> 接口实现。
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// 使用此特性可以避免手动实现 IPrioritized 接口。
|
|
/// 优先级值越小,优先级越高(负数表示高优先级)。
|
|
/// </remarks>
|
|
/// <example>
|
|
/// <code>
|
|
/// [Priority(10)]
|
|
/// public partial class MySystem : AbstractSystem
|
|
/// {
|
|
/// // 自动生成: public int Priority => 10;
|
|
/// }
|
|
/// </code>
|
|
/// </example>
|
|
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
|
|
public sealed class PriorityAttribute : Attribute
|
|
{
|
|
/// <summary>
|
|
/// 初始化 <see cref="PriorityAttribute"/> 类的新实例
|
|
/// </summary>
|
|
/// <param name="value">优先级值,越小优先级越高</param>
|
|
public PriorityAttribute(int value)
|
|
{
|
|
Value = value;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取优先级值
|
|
/// </summary>
|
|
public int Value { get; }
|
|
} |