public IGuildSetting this[Setting_Key Key] { get { //If it doesn't exist, create it. if (Settings.FirstOrDefault(o => o.Key == Key).IsNotNull(out var setting)) { return(setting); } this[Key] = new GuildSetting(Key); return(Settings.FirstOrDefault(o => o.Key == Key)); } set { if (value is GuildSetting gs) //its a new value. { Settings.Add(gs); } else { throw new Exception("Non GuildSetting IGuildSetting detected??"); } } }
public GuildSetting(Setting_Key Key) { this.Key = Key; }