예제 #1
0
        private void PopulateItemsDetails(GuildMemberStats member, PlayerItemDetails itemDetails)
        {
            member.EquippedIlvl = itemDetails.EquippedIlvl;
            member.MaximumIlvl  = itemDetails.MaximumIlvl;

            member.AzeriteLevel = itemDetails.AzeriteLevel.HasValue ? itemDetails.AzeriteLevel.Value : 0;
        }
예제 #2
0
        public static PlayerItemDetails GetItemsDetailsFromJson(string json)
        {
            PlayerItemDetails itemDetails = new PlayerItemDetails();

            var jObject = JsonConvert.DeserializeObject(json) as JObject;

            var items = jObject.SelectToken("items");

            var lastModified = jObject.SelectToken("lastModified").ToString();

            itemDetails.LastModifiedDateTime = BlizzardService.FromUnixTime(long.Parse(lastModified));
            itemDetails.EquippedIlvl         = int.Parse(items["averageItemLevelEquipped"].ToString());
            itemDetails.MaximumIlvl          = int.Parse(items["averageItemLevel"].ToString());

            var neckNode = items.SelectToken("neck");

            if (neckNode["name"].ToString() == "Heart of Azeroth")
            {
                itemDetails.AzeriteLevel = int.Parse(neckNode.SelectToken("azeriteItem.azeriteLevel").ToString());
            }

            return(itemDetails);
        }