mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
新增 `ArchitecturePhase` 枚举及生命周期接口,支持在不同阶段执行相应逻辑。 实现基于阶段的状态转换控制与校验,增强架构初始化流程的可控性与扩展性。 添加模块安装接口 `IArchitectureModule` 及相关感知接口,便于插件化集成。 完善系统与模型注册限制,禁止在就绪后注册组件,提升运行时稳定性。 移除旧版补丁注册机制,统一通过生命周期钩子进行扩展。
21 lines
1.0 KiB
C#
21 lines
1.0 KiB
C#
|
|
using System.Collections.Immutable;
|
|
|
|
namespace GFramework.Core.architecture;
|
|
|
|
public static class ArchitectureConstants
|
|
{
|
|
public static readonly ImmutableDictionary<ArchitecturePhase, ArchitecturePhase[]> PhaseTransitions =
|
|
new Dictionary<ArchitecturePhase, ArchitecturePhase[]>
|
|
{
|
|
{ ArchitecturePhase.Created, [ArchitecturePhase.BeforeInit] },
|
|
{ ArchitecturePhase.BeforeInit, [ArchitecturePhase.AfterInit] },
|
|
{ ArchitecturePhase.AfterInit, [ArchitecturePhase.BeforeModelInit] },
|
|
{ ArchitecturePhase.BeforeModelInit, [ArchitecturePhase.AfterModelInit] },
|
|
{ ArchitecturePhase.AfterModelInit, [ArchitecturePhase.BeforeSystemInit] },
|
|
{ ArchitecturePhase.BeforeSystemInit, [ArchitecturePhase.AfterSystemInit] },
|
|
{ ArchitecturePhase.AfterSystemInit, [ArchitecturePhase.Ready] },
|
|
{ ArchitecturePhase.Ready, [ArchitecturePhase.Destroying] },
|
|
{ ArchitecturePhase.Destroying, [ArchitecturePhase.Destroyed] }
|
|
}.ToImmutableDictionary();
|
|
} |