mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 移除了 IArchitectureRuntime 接口和 ArchitectureRuntime 类 - 在 ArchitectureContext 中添加了对 ICommandBus 和 IQueryBus 的依赖注入 - 修改 Architecture 类以使用 CommandBus 和 QueryBus 替代 Runtime - 更新 ArchitectureServices 以提供 CommandBus 和 QueryBus 服务 - 将组件初始化逻辑从 if-else 改为 switch 语句 - 更新 ContextAwareBase 以使用新的 GetFirstArchitectureContext 方法 - 添加了 CommandBus 和 QueryBus 的实现类 - 修复了 Godot 模块中系统获取的重复代码问题
21 lines
696 B
C#
21 lines
696 B
C#
namespace GFramework.Core.Abstractions.command;
|
|
|
|
/// <summary>
|
|
/// 定义命令总线接口,用于执行各种命令
|
|
/// </summary>
|
|
public interface ICommandBus
|
|
{
|
|
/// <summary>
|
|
/// 发送并执行一个命令
|
|
/// </summary>
|
|
/// <param name="command">要执行的命令对象</param>
|
|
public void Send(ICommand command);
|
|
|
|
/// <summary>
|
|
/// 发送并执行一个带返回值的命令
|
|
/// </summary>
|
|
/// <typeparam name="TResult">命令执行结果的类型</typeparam>
|
|
/// <param name="command">要执行的带返回值的命令对象</param>
|
|
/// <returns>命令执行的结果</returns>
|
|
public TResult Send<TResult>(ICommand<TResult> command);
|
|
} |