using Nebula.Shared.Configurations.Migrations; using Nebula.Shared.Services; namespace Nebula.Shared.Configurations; public static class ConVarBuilder { public static ConVar Build(string name, T? defaultValue = default) { if (string.IsNullOrWhiteSpace(name)) throw new ArgumentException("ConVar name cannot be null or whitespace.", nameof(name)); return new ConVar(name, defaultValue); } public static ConVar BuildWithMigration(string name, IConfigurationMigration migration, T? defaultValue = default) { if (string.IsNullOrWhiteSpace(name)) throw new ArgumentException("ConVar name cannot be null or whitespace.", nameof(name)); ConfigurationService.AddConfigurationMigration(migration); return new ConVar(name, defaultValue); } }