public static StudentJson[] LoadFromJson(string path)
 {
     StudentJson[] array = new StudentJson[101];
     for (int i = 0; i < array.Length; i++)
     {
         array[i] = new StudentJson();
     }
     foreach (Dictionary <string, object> dictionary in JsonData.Deserialize(path))
     {
         int num = TFUtils.LoadInt(dictionary, "ID");
         if (num == 0)
         {
             break;
         }
         StudentJson studentJson = array[num];
         studentJson.name       = TFUtils.LoadString(dictionary, "Name");
         studentJson.realname   = TFUtils.LoadString(dictionary, "RealName");
         studentJson.gender     = TFUtils.LoadInt(dictionary, "Gender");
         studentJson.classID    = TFUtils.LoadInt(dictionary, "Class");
         studentJson.seat       = TFUtils.LoadInt(dictionary, "Seat");
         studentJson.club       = (ClubType)TFUtils.LoadInt(dictionary, "Club");
         studentJson.persona    = (PersonaType)TFUtils.LoadInt(dictionary, "Persona");
         studentJson.crush      = TFUtils.LoadInt(dictionary, "Crush");
         studentJson.breastSize = TFUtils.LoadFloat(dictionary, "BreastSize");
         studentJson.strength   = TFUtils.LoadInt(dictionary, "Strength");
         studentJson.hairstyle  = TFUtils.LoadString(dictionary, "Hairstyle");
         studentJson.color      = TFUtils.LoadString(dictionary, "Color");
         studentJson.eyes       = TFUtils.LoadString(dictionary, "Eyes");
         studentJson.eyeType    = TFUtils.LoadString(dictionary, "EyeType");
         studentJson.stockings  = TFUtils.LoadString(dictionary, "Stockings");
         studentJson.accessory  = TFUtils.LoadString(dictionary, "Accessory");
         studentJson.info       = TFUtils.LoadString(dictionary, "Info");
         if (GameGlobals.LoveSick)
         {
             studentJson.name     = studentJson.realname;
             studentJson.realname = "";
         }
         if (OptionGlobals.HighPopulation && studentJson.name == "Unknown")
         {
             studentJson.name = "Random";
         }
         float[]  array3 = StudentJson.ConstructTempFloatArray(TFUtils.LoadString(dictionary, "ScheduleTime"));
         string[] array4 = StudentJson.ConstructTempStringArray(TFUtils.LoadString(dictionary, "ScheduleDestination"));
         string[] array5 = StudentJson.ConstructTempStringArray(TFUtils.LoadString(dictionary, "ScheduleAction"));
         studentJson.scheduleBlocks = new ScheduleBlock[array3.Length];
         for (int k = 0; k < studentJson.scheduleBlocks.Length; k++)
         {
             studentJson.scheduleBlocks[k] = new ScheduleBlock(array3[k], array4[k], array5[k]);
         }
         if (num == 10 || num == 11)
         {
             for (int l = 0; l < studentJson.scheduleBlocks.Length; l++)
             {
                 studentJson.scheduleBlocks[l] = null;
             }
         }
         studentJson.success = true;
     }
     return(array);
 }
Example #2
0
 private static JsonData DecodeWebResponse(WebResponse webResponse)
 {
     using (webResponse)
         using (var responseStream = webResponse.GetResponseStream())
             using (var stream = new MemoryStream())
             {
                 responseStream?.CopyTo(stream);
                 var responseString = Encoding.UTF8.GetString(stream.ToArray());
                 return(JsonData.Deserialize(responseString));
             }
 }
Example #3
0
    // Token: 0x06000571 RID: 1393 RVA: 0x0004B05C File Offset: 0x0004945C
    public static CreditJson[] LoadFromJson(string path)
    {
        List <CreditJson> list = new List <CreditJson>();

        foreach (Dictionary <string, object> dictionary in JsonData.Deserialize(path))
        {
            list.Add(new CreditJson {
                name = TFUtils.LoadString(dictionary, "Name"),
                size = TFUtils.LoadInt(dictionary, "Size")
            });
        }
        return(list.ToArray());
    }
 public static TopicJson[] LoadFromJson(string path)
 {
     TopicJson[] array = new TopicJson[101];
     foreach (Dictionary <string, object> d in JsonData.Deserialize(path))
     {
         int num = TFUtils.LoadInt(d, "ID");
         if (num == 0)
         {
             break;
         }
         array[num] = new TopicJson();
         TopicJson topicJson = array[num];
         topicJson.topics = new int[26];
         for (int j = 1; j <= 25; j++)
         {
             topicJson.topics[j] = TFUtils.LoadInt(d, j.ToString());
         }
     }
     return(array);
 }
Example #5
0
 public UpdateResponse ConvertWebhookResponse(string json)
 {
     Log.Info(nameof(ConvertWebhookResponse));
     return(UpdateResponse.Parse(JsonData.Deserialize(json)));
 }