Esempio n. 1
0
 private void LoadSaveFile(BinaryReader reader)
 {
     this.SaveData = SaveFileOperations.Read(new CrcReader(reader));
 }
Esempio n. 2
0
 private void ReloadSlots()
 {
     for (int index = 0; index < 3; ++index)
     {
         SaveSlotInfo saveSlotInfo = this.Slots[index] = new SaveSlotInfo()
         {
             Index = index
         };
         PCSaveDevice pcSaveDevice = new PCSaveDevice("FEZ");
         string       fileName     = "SaveSlot" + (object)index;
         if (!pcSaveDevice.FileExists(fileName))
         {
             saveSlotInfo.Empty = true;
         }
         else
         {
             SaveData saveData = (SaveData)null;
             if (!pcSaveDevice.Load(fileName, (LoadAction)(stream => saveData = SaveFileOperations.Read(new CrcReader(stream)))) || saveData == null)
             {
                 saveSlotInfo.Empty = true;
             }
             else
             {
                 saveSlotInfo.Percentage = (float)(((double)(saveData.CubeShards + saveData.SecretCubes + saveData.PiecesOfHeart) + (double)saveData.CollectedParts / 8.0) / 32.0);
                 saveSlotInfo.PlayTime   = new TimeSpan(saveData.PlayTime);
                 saveSlotInfo.SaveData   = saveData;
             }
         }
     }
 }