From 8c8373d844247589ec9f76f7c82a252baa27e416 Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Sat, 11 Apr 2026 08:44:37 +0800 Subject: [PATCH] =?UTF-8?q?refactor(config):=20=E6=9B=B4=E6=96=B0=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=8A=A0=E8=BD=BD=E5=99=A8=E4=BE=9D=E8=B5=96=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加事件抽象依赖项到YAML配置加载器 - 添加YamlDotNet序列化库依赖项 - 为Godot平台配置文件访问添加别名引用 - 在测试文件中添加配置依赖项引用 --- GFramework.Game/Config/YamlConfigLoader.cs | 3 +++ .../Config/GodotYamlConfigLoaderTests.cs | 9 +++++---- GFramework.Godot/Config/GodotYamlConfigLoader.cs | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/GFramework.Game/Config/YamlConfigLoader.cs b/GFramework.Game/Config/YamlConfigLoader.cs index 68f448f2..ce6d9ae3 100644 --- a/GFramework.Game/Config/YamlConfigLoader.cs +++ b/GFramework.Game/Config/YamlConfigLoader.cs @@ -1,5 +1,8 @@ using System.Diagnostics; +using GFramework.Core.Abstractions.Events; using GFramework.Game.Abstractions.Config; +using YamlDotNet.Serialization; +using YamlDotNet.Serialization.NamingConventions; namespace GFramework.Game.Config; diff --git a/GFramework.Godot.Tests/Config/GodotYamlConfigLoaderTests.cs b/GFramework.Godot.Tests/Config/GodotYamlConfigLoaderTests.cs index d3c0f84c..33a0feb6 100644 --- a/GFramework.Godot.Tests/Config/GodotYamlConfigLoaderTests.cs +++ b/GFramework.Godot.Tests/Config/GodotYamlConfigLoaderTests.cs @@ -1,6 +1,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using GFramework.Game.Abstractions.Config; +using GFramework.Game.Config; using GFramework.Godot.Config; namespace GFramework.Godot.Tests.Config; @@ -11,10 +12,6 @@ namespace GFramework.Godot.Tests.Config; [TestFixture] public sealed class GodotYamlConfigLoaderTests { - private string _resourceRoot = null!; - private string _testRoot = null!; - private string _userRoot = null!; - /// /// 为每个测试准备独立的资源根目录与用户目录。 /// @@ -43,6 +40,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 81b1d0d8..51742da9 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;