Beispiel #1
0
        /// <summary>
        /// Retrived the global achievements stats for a game
        /// </summary>
        /// <param name="appid">The game to retrive the achievements for</param>
        /// <returns>AchievementData Array containing all the achivements that the game has</returns>
        public IAchievementData[] GetGameGlobalAchievements(int appid)
        {
            string result = GetDataFromUrl(Tags.steamApiUrl + "ISteamUserStats/GetGlobalAchievementPercentagesForApp/v0002/?gameid=" + appid + "&format=json");
            IDictionary mainDic = Serialization.MiniJSON.Json.Deserialize(result) as IDictionary;
            IDictionary secDic = mainDic["achievementpercentages"] as IDictionary;
            IList achievements = secDic["achievements"] as IList;
            AchievementData[] retVal = new AchievementData[achievements.Count];

            for(int i = 0; i < retVal.Length; ++i) {
                retVal[i] = new AchievementData(achievements[i] as ICollection);
            }

            return retVal;
        }
Beispiel #2
0
        /// <summary>
        /// Retrived the global achievements stats for a game
        /// </summary>
        /// <param name="appid">The game to retrive the achievements for</param>
        /// <returns>AchievementData Array containing all the achivements that the game has</returns>
        public IAchievementData[] GetGameGlobalAchievements(int appid)
        {
            string      result       = GetDataFromUrl(Tags.steamApiUrl + "ISteamUserStats/GetGlobalAchievementPercentagesForApp/v0002/?gameid=" + appid + "&format=json");
            IDictionary mainDic      = Serialization.MiniJSON.Json.Deserialize(result) as IDictionary;
            IDictionary secDic       = mainDic["achievementpercentages"] as IDictionary;
            IList       achievements = secDic["achievements"] as IList;

            AchievementData[] retVal = new AchievementData[achievements.Count];

            for (int i = 0; i < retVal.Length; ++i)
            {
                retVal[i] = new AchievementData(achievements[i] as ICollection);
            }

            return(retVal);
        }