// C# doesn't treat static classes like objects but rather like namespaces with variables inside them. // So to get static class objects we create a single instance of the object and return it in this function. public static CheaterSet Init() { // we've already created one so we want all future instances to just be a reference to the original. // that way we don't differing values between instances. if (_cheaters is not null) { return(_cheaters); } using var reader = new StreamReader(path); var jsonString = reader.ReadToEnd(); _cheaters = JsonConvert.DeserializeObject <CheaterSet>(jsonString, JsonSettings) ?? new CheaterSet(); return(_cheaters); }