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

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

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

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

45 lines
1.8 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.Abstractions.Config;
namespace GFramework.Game.Config;
/// <summary>
/// 描述官方配置启动帮助器的初始化约定。
/// 该选项对象把配置根目录、表注册回调和热重载策略收敛到一个稳定入口,
/// 让消费项目不必在多个启动脚本里重复拼装加载器细节。
/// </summary>
public sealed class GameConfigBootstrapOptions
{
/// <summary>
/// 获取或设置配置根目录。
/// 该路径会直接传给 <see cref="YamlConfigLoader" /> 作为 YAML 与 schema 的共同根目录。
/// </summary>
public string RootPath { get; init; } = string.Empty;
/// <summary>
/// 获取或设置用于配置 <see cref="YamlConfigLoader" /> 的回调。
/// 调用方通常应在这里调用生成器产出的 <c>RegisterAllGeneratedConfigTables()</c>
/// 或显式注册当前场景所需的手写表定义。
/// </summary>
public Action<YamlConfigLoader>? ConfigureLoader { get; init; }
/// <summary>
/// 获取或设置要复用的配置注册表。
/// 为空时启动帮助器会创建默认的 <see cref="ConfigRegistry" /> 实例。
/// </summary>
public IConfigRegistry? Registry { get; init; }
/// <summary>
/// 获取或设置是否在初次加载成功后立即启用开发期热重载。
/// </summary>
public bool EnableHotReload { get; init; }
/// <summary>
/// 获取或设置初始化阶段启用热重载时使用的选项。
/// 当 <see cref="EnableHotReload" /> 为 <see langword="false" /> 时,该值会被忽略。
/// </summary>
public YamlConfigHotReloadOptions? HotReloadOptions { get; init; }
}