namespace GFramework.Godot.Config;
///
/// 描述一个 Godot YAML 配置表在资源目录中的来源信息。
///
public sealed class GodotYamlConfigTableSource
{
///
/// 初始化一个配置表来源描述。
///
/// 运行时表名称。
/// 相对配置根目录的 YAML 目录。
/// 相对配置根目录的 schema 文件路径;未启用 schema 时为空。
public GodotYamlConfigTableSource(
string tableName,
string configRelativePath,
string? schemaRelativePath = null)
{
if (string.IsNullOrWhiteSpace(tableName))
{
throw new ArgumentException("Table name cannot be null or whitespace.", nameof(tableName));
}
if (string.IsNullOrWhiteSpace(configRelativePath))
{
throw new ArgumentException("Config relative path cannot be null or whitespace.",
nameof(configRelativePath));
}
if (schemaRelativePath != null && string.IsNullOrWhiteSpace(schemaRelativePath))
{
throw new ArgumentException(
"Schema relative path cannot be empty or whitespace when provided.",
nameof(schemaRelativePath));
}
TableName = tableName;
ConfigRelativePath = configRelativePath;
SchemaRelativePath = schemaRelativePath;
}
///
/// 获取运行时表名称。
///
public string TableName { get; }
///
/// 获取相对配置根目录的 YAML 目录路径。
///
public string ConfigRelativePath { get; }
///
/// 获取相对配置根目录的 schema 文件路径;未启用 schema 校验时为空。
///
public string? SchemaRelativePath { get; }
}