コード例 #1
0
 public static Career getCareerFromBattleTag(BattleTag battleTag)
 {
     Career career;
     using (Stream stream = dataProvider.fetchData(getCareerUrl(battleTag) + apiLocaleSuffix))
     {
         career = Career.getCareerFromJSonStream(stream);
     }
     return career;
 }
コード例 #2
0
 public static Hero getHeroFromHeroID(BattleTag battleTag, String heroId)
 {
     Hero hero;
     using (Stream stream = dataProvider.fetchData(D3Api.getHeroUrlFromHeroId(battleTag, heroId) + apiLocaleSuffix))
     {
         hero = Hero.getHeroFromJSonStream(stream);
     }
     return hero;
 }
コード例 #3
0
        static void WriteCareer(BattleTag battleTag)
        {
            Career career = Career.getCareerFromBattleTag(battleTag);

            Console.WriteLine("Battletag: " + career.battleTag.id);
            foreach (HeroSummary lastHeroPlayedName in career.heroes)
            {
                if (career.lastHeroPlayed == lastHeroPlayedName.id)
                {
                    Console.WriteLine("Last played hero: " + lastHeroPlayedName.name +
                                      " (ID: " + career.lastHeroPlayed + ")");
                }
            }
            Console.WriteLine("Heroes count: " + career.heroes.Length);
            Console.WriteLine("Total kills: Monsters ({0}) Elites ({1})", career.kills.monsters, career.kills.elites);
            Console.WriteLine("Cleared Normal ({0}), Nightmare ({1}), Hell ({2}), Inferno ({3})" + "\n----",
                              career.progression.normal.act4.completed,
                              career.progression.nightmare.act4.completed,
                              career.progression.hell.act4.completed,
                              career.progression.inferno.act4.completed);
            foreach (HeroSummary heroDigest in career.heroes)
            {
                Console.WriteLine("Hero '{0}' (ID: {1}) - {2} | Level {3} + {4} | Last updated {5}",
                                  heroDigest.name,
                                  heroDigest.id,
                                  heroDigest.heroClass,
                                  heroDigest.level,
                                  heroDigest.paragonLevel, heroDigest.lastUpdated);

                Hero heroFull = heroDigest.getHeroFromBattleTag(battleTag);

                Item mainHand = Item.getItemFromTooltipParams(heroFull.items.mainHand.tooltipParams);
                Console.WriteLine("\nMain Hand: '{0}' (Type: {1}) (Rarity: {2}) (iLv: {3}) (Lv: {4}) | DPS {5} - {6}" + "\n----",
                                  mainHand.name,
                                  mainHand.typeName,
                                  mainHand.displayColor,
                                  mainHand.itemLevel,
                                  mainHand.requiredLevel,
                                  mainHand.dps.min, mainHand.dps.max);
            }
            Console.WriteLine();
            Console.WriteLine("Fallen Heroes count: " + career.fallenHeroes.Length);
            foreach (HeroSummary heroDigest in career.fallenHeroes)
            {
                Console.WriteLine("Hero {0}: {1} is {2} level {3} + {4} ", heroDigest.id, heroDigest.name, heroDigest.heroClass, heroDigest.level, heroDigest.paragonLevel);
            }
        }
コード例 #4
0
 public Hero getHeroFromBattleTag(BattleTag battleTag)
 {
     return Hero.getHeroFromHeroId(battleTag, id);
 }
コード例 #5
0
 public static String getHeroUrlFromHeroId(BattleTag battleTag, String heroId)
 {
     return getCareerUrl(battleTag) + "hero/" + heroId;
 }
コード例 #6
0
 public static String getCareerUrl(BattleTag battleTag)
 {
     return apiUrl + "profile/" + battleTag.name + "-" + battleTag.code + "/";
 }
コード例 #7
0
 public static Hero getHeroFromHeroId(BattleTag battleTag, String heroId)
 {
     return D3Api.getHeroFromHeroID(battleTag, heroId);
 }
コード例 #8
0
        public static void Main(string[] args)
        {
            BattleTag battleTag = new BattleTag("mystogan#2963"); //your battletag

            WriteCareer(battleTag);
        }
コード例 #9
0
 public static Career getCareerFromBattleTag(BattleTag battleTag)
 {
     return D3Api.getCareerFromBattleTag(battleTag);
 }