public object Clone() { Settings res = new Settings(); res.PriceListLastAccess = PriceListLastAccess; res.MarketPricesLastAccess = MarketPricesLastAccess; res.SchemaLastAccess = SchemaLastAccess; res.BackpackLastAccess = BackpackLastAccess; res.FriendsListLastAccess = FriendsListLastAccess; res.DownloadTimeoutSeconds = DownloadTimeoutSeconds; res.HomeSteamID64 = HomeSteamID64; res.SteamPersonaName = SteamPersonaName; res.BackpackTFAPIKey = BackpackTFAPIKey; res.SteamAPIKey = SteamAPIKey; res.DealsPriceDropThresholdListingCount = DealsPriceDropThresholdListingCount; res.DealsPriceDropThresholdPriceBelow = DealsPriceDropThresholdPriceBelow; return res; }
public static Settings Load(bool affectInstance = true) { Settings res; VersatileIO.Debug("Loading settings"); if (!Directory.Exists(LOCATION)) { Directory.CreateDirectory(LOCATION); } if (File.Exists(FILEPATH)) { string contents = File.ReadAllText(FILEPATH); res = JsonConvert.DeserializeObject<Settings>(contents); } else { res = new Settings(); } VersatileIO.Verbose(" Settings loaded."); if (affectInstance) { Instance = res; } res.Initialized = true; return res; }