using Newtonsoft.Json; using System; using System.Collections.Generic; namespace SPT.Custom.Models { [Serializable] public struct DifficultyInfo { public Dictionary this[string key] { get { switch (key) { case "easy": return easy; case "hard": return hard; case "impossible": return impossible; case "normal": return normal; default: throw new ArgumentException($"Difficulty '{key}' does not exist in DifficultyInfo."); } } } [JsonProperty("easy")] public Dictionary easy; [JsonProperty("hard")] public Dictionary hard; [JsonProperty("impossible")] public Dictionary impossible; [JsonProperty("normal")] public Dictionary normal; } }