GFramework/GFramework.Godot/Config/GodotYamlConfigLoaderOptions.cs
gewuyou ff553977e3 chore(license): 补齐 Apache-2.0 文件头治理
- 新增许可证文件头检查与修复脚本

- 补充维护者手动修复 PR 工作流和 CI 校验

- 更新贡献指南中的文件头说明

- 补齐仓库维护源码和配置文件的许可证声明
2026-05-03 19:39:49 +08:00

40 lines
1.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Copyright (c) 2025-2026 GeWuYou
// SPDX-License-Identifier: Apache-2.0
using GFramework.Game.Config;
namespace GFramework.Godot.Config;
/// <summary>
/// 描述 Godot YAML 配置加载器的初始化约定。
/// </summary>
public sealed class GodotYamlConfigLoaderOptions
{
/// <summary>
/// 获取或设置配置源根目录。
/// 默认值为 <c>res://</c>,表示从项目资源路径读取 YAML 与 schema 文本。
/// </summary>
public string SourceRootPath { get; init; } = "res://";
/// <summary>
/// 获取或设置运行时缓存根目录。
/// 当 <see cref="SourceRootPath" /> 在当前环境下无法直接映射为普通文件系统目录时,
/// 加载器会先把所需文本资产复制到这里,再交给底层 <see cref="YamlConfigLoader" />。
/// </summary>
public string RuntimeCacheRootPath { get; init; } = "user://config_cache";
/// <summary>
/// 获取或设置本次启动会访问到的配置表来源描述。
/// Godot 导出态无法假设任意文本目录都可被枚举,因此调用方应显式提供参与本轮加载的配置目录与 schema 文件。
/// </summary>
public IReadOnlyCollection<GodotYamlConfigTableSource> TableSources { get; init; } =
Array.Empty<GodotYamlConfigTableSource>();
/// <summary>
/// 获取或设置用于配置底层 <see cref="YamlConfigLoader" /> 的回调。
/// 调用方通常应在这里调用生成器产出的 <c>RegisterAllGeneratedConfigTables()</c>
/// 或显式注册当前场景所需的手写表定义。
/// </summary>
public Action<YamlConfigLoader>? ConfigureLoader { get; init; }
}