/**
  * callback method for native code
  **/
 public static void RequestAchievementsSucceeded(string json)
 {
     if (RequestAchievementsSucceededEvent != null)
     {
         var Achievements = new List <AGSAchievement>();
         var list         = json.arrayListFromJson();
         foreach (Hashtable ht in list)
         {
             Achievements.Add(AGSAchievement.fromHashtable(ht));
         }
         RequestAchievementsSucceededEvent(Achievements);
     }
 }
 public static AGSRequestAchievementsResponse FromJSON(string json)
 {
     try {
         AGSRequestAchievementsResponse response = new AGSRequestAchievementsResponse();
         Hashtable hashtable = json.hashtableFromJson();
         response.error        = hashtable.ContainsKey("error") ? hashtable ["error"].ToString() : "";
         response.userData     = hashtable.ContainsKey("userData") ? int.Parse(hashtable ["userData"].ToString()) : 0;
         response.achievements = new List <AGSAchievement>();
         if (hashtable.ContainsKey("achievements"))
         {
             foreach (Hashtable achievementHashtable in hashtable["achievements"] as ArrayList)
             {
                 response.achievements.Add(AGSAchievement.fromHashtable(achievementHashtable));
             }
         }
         return(response);
     } catch (Exception e) {
         AGSClient.LogGameCircleError(e.ToString());
         return(GetBlankResponseWithError(JSON_PARSE_ERROR));
     }
 }