From 0ea3c0ad9da9d319d807068247a60c5ee3ebafd0 Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Fri, 10 Apr 2026 23:10:06 +0800 Subject: [PATCH] =?UTF-8?q?refactor(config):=20=E6=9B=B4=E6=96=B0Godot=20Y?= =?UTF-8?q?AML=E9=85=8D=E7=BD=AE=E5=8A=A0=E8=BD=BD=E5=99=A8=E7=9A=84?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E7=A9=BA=E9=97=B4=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为Godot.FileAccess添加using别名以避免冲突 - 添加GFramework.Game.Config命名空间引用 - 添加NUnit.Framework测试框架引用 - 优化配置加载器的依赖管理 - 提升代码可读性和维护性 - 确保测试类的正确引用关系 --- .../Config/GodotYamlConfigLoaderTests.cs | 10 ++++++---- GFramework.Godot/Config/GodotYamlConfigLoader.cs | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/GFramework.Godot.Tests/Config/GodotYamlConfigLoaderTests.cs b/GFramework.Godot.Tests/Config/GodotYamlConfigLoaderTests.cs index 52ef30fa..7fa43f71 100644 --- a/GFramework.Godot.Tests/Config/GodotYamlConfigLoaderTests.cs +++ b/GFramework.Godot.Tests/Config/GodotYamlConfigLoaderTests.cs @@ -2,7 +2,9 @@ using System; using System.IO; using System.Linq; using System.Threading.Tasks; +using GFramework.Game.Config; using GFramework.Godot.Config; +using NUnit.Framework; namespace GFramework.Godot.Tests.Config; @@ -12,10 +14,6 @@ namespace GFramework.Godot.Tests.Config; [TestFixture] public sealed class GodotYamlConfigLoaderTests { - private string _resourceRoot = null!; - private string _testRoot = null!; - private string _userRoot = null!; - /// /// 为每个测试准备独立的资源根目录与用户目录。 /// @@ -44,6 +42,10 @@ public sealed class GodotYamlConfigLoaderTests } } + private string _resourceRoot = null!; + private string _testRoot = null!; + private string _userRoot = null!; + /// /// 验证导出态会把注册过的 YAML 与 schema 文本同步到运行时缓存,再交给底层加载器。 /// diff --git a/GFramework.Godot/Config/GodotYamlConfigLoader.cs b/GFramework.Godot/Config/GodotYamlConfigLoader.cs index 35b59196..3cd9de8c 100644 --- a/GFramework.Godot/Config/GodotYamlConfigLoader.cs +++ b/GFramework.Godot/Config/GodotYamlConfigLoader.cs @@ -3,6 +3,7 @@ using GFramework.Core.Abstractions.Events; using GFramework.Game.Abstractions.Config; using GFramework.Game.Config; using GFramework.Godot.Extensions; +using FileAccess = Godot.FileAccess; namespace GFramework.Godot.Config;