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);
 }
Ejemplo n.º 2
0
 // Token: 0x0600026E RID: 622 RVA: 0x00032494 File Offset: 0x00030894
 public static StudentEditorScript.StudentCosmetics Deserialize(Dictionary <string, object> dict)
 {
     return(new StudentEditorScript.StudentCosmetics {
         breastSize = TFUtils.LoadFloat(dict, "BreastSize"),
         hairstyle = TFUtils.LoadString(dict, "Hairstyle"),
         color = TFUtils.LoadString(dict, "Color"),
         eyes = TFUtils.LoadString(dict, "Eyes"),
         stockings = TFUtils.LoadString(dict, "Stockings"),
         accessory = TFUtils.LoadString(dict, "Accessory")
     });
 }
Ejemplo n.º 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());
    }
Ejemplo n.º 4
0
 // Token: 0x06000270 RID: 624 RVA: 0x00032518 File Offset: 0x00030918
 public static StudentEditorScript.StudentData Deserialize(Dictionary <string, object> dict)
 {
     return(new StudentEditorScript.StudentData {
         id = TFUtils.LoadInt(dict, "ID"),
         name = TFUtils.LoadString(dict, "Name"),
         isMale = (TFUtils.LoadInt(dict, "Gender") == 1),
         attendanceInfo = StudentEditorScript.StudentAttendanceInfo.Deserialize(dict),
         personality = StudentEditorScript.StudentPersonality.Deserialize(dict),
         stats = StudentEditorScript.StudentStats.Deserialize(dict),
         cosmetics = StudentEditorScript.StudentCosmetics.Deserialize(dict),
         scheduleBlocks = StudentEditorScript.DeserializeScheduleBlocks(dict),
         info = TFUtils.LoadString(dict, "Info")
     });
 }
 private static ScheduleBlock[] DeserializeScheduleBlocks(Dictionary <string, object> dict)
 {
     string[] array = TFUtils.LoadString(dict, "ScheduleTime").Split(new char[]
     {
         '_'
     });
     string[] array2 = TFUtils.LoadString(dict, "ScheduleDestination").Split(new char[]
     {
         '_'
     });
     string[] array3 = TFUtils.LoadString(dict, "ScheduleAction").Split(new char[]
     {
         '_'
     });
     ScheduleBlock[] array4 = new ScheduleBlock[array.Length];
     for (int i = 0; i < array4.Length; i++)
     {
         array4[i] = new ScheduleBlock(float.Parse(array[i]), array2[i], array3[i]);
     }
     return(array4);
 }