using System; using System.Collections.Generic; using Newtonsoft.Json; #nullable enable namespace BililiveRecorder.Core.Config.V2 { [Obsolete("Use Config v3")] internal class ConfigV2 : ConfigBase { public override int Version => 2; [JsonProperty("global")] public GlobalConfig Global { get; set; } = new GlobalConfig(); [JsonProperty("rooms")] public List Rooms { get; set; } = new List(); [JsonIgnore] public bool DisableConfigSave { get; set; } = false; // for CLI } [Obsolete("Use Config v3")] internal partial class RoomConfig { public RoomConfig() : base(x => x.AutoMap(p => new[] { "Has" + p.Name })) { } internal void SetParent(GlobalConfig? config) => this.Parent = config; public string? WorkDirectory => this.GetPropertyValue(); } [Obsolete("Use Config v3")] internal partial class GlobalConfig { public GlobalConfig() : base(x => x.AutoMap(p => new[] { "Has" + p.Name })) { this.Parent = DefaultConfig.Instance; } /// /// 当前工作目录 /// public string? WorkDirectory { get => this.GetPropertyValue(); set => this.SetPropertyValue(value); } } }