Exemplo n.º 1
0
 public override void Initialize()
 {
   base.Initialize();
   this.Title = "SaveSlotTitle";
   this.AButtonString = "ChooseWithGlyph";
   this.BButtonString = "ExitWithGlyph";
   this.GameState = ServiceHelper.Get<IGameStateManager>();
   for (int index = 0; index < 3; ++index)
   {
     // ISSUE: object of a compiler-generated type is created
     // ISSUE: variable of a compiler-generated type
     SaveSlotSelectionLevel.\u003C\u003Ec__DisplayClassa cDisplayClassa = new SaveSlotSelectionLevel.\u003C\u003Ec__DisplayClassa();
     // ISSUE: reference to a compiler-generated field
     cDisplayClassa.\u003C\u003E4__this = this;
     // ISSUE: reference to a compiler-generated field
     cDisplayClassa.slot = this.Slots[index] = new SaveSlotInfo()
     {
       Index = index
     };
     PCSaveDevice pcSaveDevice = new PCSaveDevice("FEZ");
     string fileName = "SaveSlot" + (object) index;
     if (!pcSaveDevice.FileExists(fileName))
     {
       // ISSUE: reference to a compiler-generated field
       cDisplayClassa.slot.Empty = true;
     }
     else
     {
       // ISSUE: object of a compiler-generated type is created
       // ISSUE: variable of a compiler-generated type
       SaveSlotSelectionLevel.\u003C\u003Ec__DisplayClassc cDisplayClassc = new SaveSlotSelectionLevel.\u003C\u003Ec__DisplayClassc();
       // ISSUE: reference to a compiler-generated field
       cDisplayClassc.CS\u0024\u003C\u003E8__localsb = cDisplayClassa;
       // ISSUE: reference to a compiler-generated field
       cDisplayClassc.saveData = (SaveData) null;
       // ISSUE: reference to a compiler-generated method
       // ISSUE: reference to a compiler-generated field
       if (!pcSaveDevice.Load(fileName, new LoadAction(cDisplayClassc.\u003CInitialize\u003Eb__4)) || cDisplayClassc.saveData == null)
       {
         // ISSUE: reference to a compiler-generated field
         cDisplayClassa.slot.Empty = true;
       }
       else
       {
         // ISSUE: reference to a compiler-generated field
         // ISSUE: reference to a compiler-generated field
         // ISSUE: reference to a compiler-generated field
         // ISSUE: reference to a compiler-generated field
         // ISSUE: reference to a compiler-generated field
         cDisplayClassa.slot.Percentage = (float) (((double) (cDisplayClassc.saveData.CubeShards + cDisplayClassc.saveData.SecretCubes + cDisplayClassc.saveData.PiecesOfHeart) + (double) cDisplayClassc.saveData.CollectedParts / 8.0) / 32.0);
         // ISSUE: reference to a compiler-generated field
         // ISSUE: reference to a compiler-generated field
         cDisplayClassa.slot.PlayTime = new TimeSpan(cDisplayClassc.saveData.PlayTime);
       }
     }
     if (this.Slots[index].Empty)
     {
       // ISSUE: reference to a compiler-generated method
       this.AddItem((string) null, new Action(cDisplayClassa.\u003CInitialize\u003Eb__5), -1).SuffixText = (Func<string>) (() => StaticText.GetString("NewSlot"));
     }
     else
     {
       // ISSUE: reference to a compiler-generated method
       // ISSUE: reference to a compiler-generated method
       this.AddItem("SaveSlotPrefix", new Action(cDisplayClassa.\u003CInitialize\u003Eb__7), -1).SuffixText = new Func<string>(cDisplayClassa.\u003CInitialize\u003Eb__8);
     }
   }
 }
Exemplo 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;
       }
     }
   }
 }