Exemplo n.º 1
0
        public static MinPriceManager LoadFromFile(string itemName)
        {
            string path = $"{priceDataLocation}\\{itemName}.json";

            if (File.Exists(path))
            {
                return(Serializer.LoadFromFile <MinPriceManager>(path));
            }

            var newManager = new MinPriceManager();

            newManager.ItemName = itemName;
            SaveToFile(newManager);
            return(newManager);
        }
Exemplo n.º 2
0
        public static void SaveToFile(MinPriceManager minPriceManager)
        {
            string path = $"{priceDataLocation}\\{minPriceManager.ItemName}.json";

            Serializer.SaveToFile(minPriceManager, path);
        }
        public MinPriceManager GetMinPriceForItem(string itemName)
        {
            var minPriceMgr = MinPriceManager.LoadFromFile(itemName);

            return(minPriceMgr);
        }