mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-07 17:21:16 +08:00
- 新增项目级 `-pr-review` 技能与 PR 页面抓取脚本,提取 CodeRabbit 评论、检查结果和测试状态 - 修复 gframework-boot 与 AGENTS 规则文案,使 resume/recovery 与 tracking 条件保持一致 - 更新 Godot 模板与 IController 文档注释中的旧 SourceGenerators Rule 命名空间引用 - 补充 CQRS 迁移 tracking 与 trace 的 RP-042 恢复点、验证结果和后续动作
39 lines
1.4 KiB
C#
39 lines
1.4 KiB
C#
namespace GFramework.Core.Abstractions.Controller;
|
||
|
||
/// <summary>
|
||
/// 控制器标记接口,用于标识控制器组件
|
||
/// </summary>
|
||
/// <remarks>
|
||
/// <para>
|
||
/// IController 是一个标记接口(Marker Interface),不包含任何方法或属性。
|
||
/// 它的作用是标识一个类是控制器,用于协调 Model、System 和 UI 之间的交互。
|
||
/// </para>
|
||
/// <para>
|
||
/// 架构访问 :控制器通常需要访问架构上下文。使用 [ContextAware] 特性
|
||
/// 自动生成上下文访问能力:
|
||
/// </para>
|
||
/// <code>
|
||
/// using GFramework.Core.SourceGenerators.Abstractions.Rule;
|
||
///
|
||
/// [ContextAware]
|
||
/// public partial class PlayerController : IController
|
||
/// {
|
||
/// public void Initialize()
|
||
/// {
|
||
/// // [ContextAware] 实现 IContextAware 接口,可使用扩展方法
|
||
/// var playerModel = this.GetModel<PlayerModel>();
|
||
/// var gameSystem = this.GetSystem<GameSystem>();
|
||
/// }
|
||
/// }
|
||
/// </code>
|
||
/// <para>
|
||
/// 注意:
|
||
/// </para>
|
||
/// <list type="bullet">
|
||
/// <item>必须添加 partial 关键字</item>
|
||
/// <item>[ContextAware] 特性会自动实现 IContextAware 接口</item>
|
||
/// <item>可使用 this.GetModel()、this.GetSystem() 等扩展方法访问架构</item>
|
||
/// </list>
|
||
/// </remarks>
|
||
public interface IController;
|