From 209c331d1f542410459c790e388719ba2dda6601 Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Fri, 30 Jan 2026 21:48:44 +0800 Subject: [PATCH] =?UTF-8?q?refactor(setting):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=BA=94=E7=94=A8=E5=99=A8=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=B8=AD=E7=9A=84new()=E7=BA=A6=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 从RegisterApplicator方法的泛型约束中移除new()要求 - 修改实现类SettingsModel中的方法签名以匹配接口变更 - 更新抽象层ISettingsModel中的方法约束定义 - 保持原有功能完整性的同时提高代码灵活性 - [release ci] --- GFramework.Game.Abstractions/setting/ISettingsModel.cs | 2 +- GFramework.Game/setting/SettingsModel.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GFramework.Game.Abstractions/setting/ISettingsModel.cs b/GFramework.Game.Abstractions/setting/ISettingsModel.cs index 5c4acc4..3349e62 100644 --- a/GFramework.Game.Abstractions/setting/ISettingsModel.cs +++ b/GFramework.Game.Abstractions/setting/ISettingsModel.cs @@ -39,7 +39,7 @@ public interface ISettingsModel : IModel /// 要注册的设置应用器 /// 当前设置模型实例,支持链式调用 ISettingsModel RegisterApplicator(IResetApplyAbleSettings applicator) - where T : class, IResetApplyAbleSettings, new(); + where T : class, IResetApplyAbleSettings; /// diff --git a/GFramework.Game/setting/SettingsModel.cs b/GFramework.Game/setting/SettingsModel.cs index a2af8c1..1edcdd8 100644 --- a/GFramework.Game/setting/SettingsModel.cs +++ b/GFramework.Game/setting/SettingsModel.cs @@ -63,7 +63,7 @@ public class SettingsModel : AbstractModel, ISettingsModel /// 注册设置应用器 /// public ISettingsModel RegisterApplicator(IResetApplyAbleSettings applicator) - where T : class, IResetApplyAbleSettings, new() + where T : class, IResetApplyAbleSettings { _applicators[typeof(T)] = applicator; return this;