public WowHeadAchievementParser(List <string> ids)
 {
     foreach (var id in ids)
     {
         if (!string.IsNullOrEmpty(id))
         {
             var achievement = BlizzardParser.Parse(id);
             this.items.Add(new WowHeadAchievement(achievement));
         }
     }
 }
 public WowHeadMountParser(List <string> ids)
 {
     foreach (var id in ids)
     {
         var mount = BlizzardParser.ParseMount(id);
         if (mount != null)
         {
             this.items.Add(new WowHeadMount(mount));
         }
     }
 }
 public WowHeadPetParser(List <string> ids)
 {
     foreach (var id in ids)
     {
         var pet = BlizzardParser.ParsePet(id);
         if (pet != null)
         {
             this.items.Add(new WowHeadPet(pet));
         }
     }
 }
Beispiel #4
0
        private void FixPoints()
        {
            var ap = (AchievementParser)this.parser;

            var sb           = new StringBuilder("messed: (");
            var missing      = new StringBuilder("missing:" + Environment.NewLine);
            var checkedCount = 0;

            foreach (var sc in ap.Achievements.supercats)
            {
                if (sc.name == "Legacy" || sc.name == "Feats of Strength")
                {
                    continue;
                }

                foreach (var c in sc.cats)
                {
                    foreach (var z in c.zones)
                    {
                        foreach (var a in z.achs)
                        {
                            // Query blizzard
                            try
                            {
                                checkedCount++;
                                var ba = BlizzardParser.Parse(a.id);
                                if (ba.points != a.points)
                                {
                                    sb.AppendLine(ba.id + " : " + ba.title);
                                    a.points = ba.points;
                                }
                            }
                            catch (Exception e)
                            {
                                missing.AppendLine(a.id);
                            }
                        }
                    }
                }
            }

            sb.Append(checkedCount + ")" + Environment.NewLine);
            MessageBox.Show(sb.ToString());
            MessageBox.Show(missing.ToString());
        }