diff --git a/GFramework.Core/architecture/Architecture.cs b/GFramework.Core/architecture/Architecture.cs index ccf779c..c861df5 100644 --- a/GFramework.Core/architecture/Architecture.cs +++ b/GFramework.Core/architecture/Architecture.cs @@ -144,7 +144,7 @@ public abstract class Architecture : IArchitecture where T : Architecture, /// /// 目标系统类型 /// 对应的系统实例 - public TSystem GetSystem() where TSystem : class, ISystem + public TSystem? GetSystem() where TSystem : class, ISystem { return _mContainer.Get(); } @@ -154,7 +154,7 @@ public abstract class Architecture : IArchitecture where T : Architecture, /// /// 目标模型类型 /// 对应的模型实例 - public TModel GetModel() where TModel : class, IModel + public TModel? GetModel() where TModel : class, IModel { return _mContainer.Get(); } @@ -164,7 +164,7 @@ public abstract class Architecture : IArchitecture where T : Architecture, /// /// 目标工具类型 /// 对应的工具实例 - public TUtility GetUtility() where TUtility : class, IUtility + public TUtility? GetUtility() where TUtility : class, IUtility { return _mContainer.Get(); } diff --git a/GFramework.Core/architecture/IArchitecture.cs b/GFramework.Core/architecture/IArchitecture.cs index dd5c54d..1cf1586 100644 --- a/GFramework.Core/architecture/IArchitecture.cs +++ b/GFramework.Core/architecture/IArchitecture.cs @@ -39,21 +39,21 @@ public interface IArchitecture /// /// 系统类型,必须是class且实现ISystem接口 /// 指定类型的系统实例 - T GetSystem() where T : class, ISystem; + T? GetSystem() where T : class, ISystem; /// /// 从架构中获取指定类型的模型实例 /// /// 模型类型,必须是class且实现IModel接口 /// 指定类型的模型实例 - T GetModel() where T : class, IModel; + T? GetModel() where T : class, IModel; /// /// 从架构中获取指定类型的工具实例 /// /// 工具类型,必须是class且实现IUtility接口 /// 指定类型的工具实例 - T GetUtility() where T : class, IUtility; + T? GetUtility() where T : class, IUtility; /// /// 发送并执行指定的命令