示例#1
0
        public static string GetPrice(Skin skin, SkinArgs args)
        {
            string      url        = @"http://steamcommunity.com/market/priceoverview/?appid=730&currency=3&market_hash_name=";
            string      weaponName = skin.ParseName(args);
            string      response   = GetResponse(url + weaponName);
            ReqResponse req        = JsonSerializer.Deserialize <ReqResponse>(response);

            return(req.median_price);
        }
示例#2
0
        public string ParseName(SkinArgs args)
        {
            string result = "";

            if (args.statTrak)
            {
                result += "StatTrak™ ";
            }
            if (args.souvenir)
            {
                result += "Souvenir ";
            }

            result += name + " ";

            if (args.condition == 0)
            {
                result += "(Factory New)";
            }
            if (args.condition == 1)
            {
                result += "(Minimal Wear)";
            }
            if (args.condition == 2)
            {
                result += "(Field Tested)";
            }
            if (args.condition == 3)
            {
                result += "(Well Worn)";
            }
            if (args.condition == 4)
            {
                result += "(Battle Scarred)";
            }

            return(result);
        }