コード例 #1
0
ファイル: SaveFileOperations.cs プロジェクト: Zeludon/FEZ
 public static void Write(CrcWriter w, LevelSaveData lsd)
 {
   w.Write(lsd.DestroyedTriles.Count);
   foreach (TrileEmplacement s in lsd.DestroyedTriles)
     BinaryWritingTools.Write(w, s);
   w.Write(lsd.InactiveTriles.Count);
   foreach (TrileEmplacement s in lsd.InactiveTriles)
     BinaryWritingTools.Write(w, s);
   w.Write(lsd.InactiveArtObjects.Count);
   foreach (int num in lsd.InactiveArtObjects)
     w.Write(num);
   w.Write(lsd.InactiveEvents.Count);
   foreach (int num in lsd.InactiveEvents)
     w.Write(num);
   w.Write(lsd.InactiveGroups.Count);
   foreach (int num in lsd.InactiveGroups)
     w.Write(num);
   w.Write(lsd.InactiveVolumes.Count);
   foreach (int num in lsd.InactiveVolumes)
     w.Write(num);
   w.Write(lsd.InactiveNPCs.Count);
   foreach (int num in lsd.InactiveNPCs)
     w.Write(num);
   w.Write(lsd.PivotRotations.Count);
   foreach (KeyValuePair<int, int> keyValuePair in lsd.PivotRotations)
   {
     w.Write(keyValuePair.Key);
     w.Write(keyValuePair.Value);
   }
   BinaryWritingTools.WriteObject(w, lsd.LastStableLiquidHeight);
   BinaryWritingTools.WriteObject(w, lsd.ScriptingState);
   w.Write(lsd.FirstVisit);
   SaveFileOperations.Write(w, lsd.FilledConditions);
 }
コード例 #2
0
 public void CloneInto(LevelSaveData d)
 {
     this.FilledConditions.CloneInto(d.FilledConditions);
     d.FirstVisit             = this.FirstVisit;
     d.LastStableLiquidHeight = this.LastStableLiquidHeight;
     d.ScriptingState         = this.ScriptingState;
     d.DestroyedTriles.Clear();
     d.DestroyedTriles.AddRange((IEnumerable <TrileEmplacement>) this.DestroyedTriles);
     d.InactiveArtObjects.Clear();
     d.InactiveArtObjects.AddRange((IEnumerable <int>) this.InactiveArtObjects);
     d.InactiveEvents.Clear();
     d.InactiveEvents.AddRange((IEnumerable <int>) this.InactiveEvents);
     d.InactiveGroups.Clear();
     d.InactiveGroups.AddRange((IEnumerable <int>) this.InactiveGroups);
     d.InactiveNPCs.Clear();
     d.InactiveNPCs.AddRange((IEnumerable <int>) this.InactiveNPCs);
     d.InactiveTriles.Clear();
     d.InactiveTriles.AddRange((IEnumerable <TrileEmplacement>) this.InactiveTriles);
     d.InactiveVolumes.Clear();
     d.InactiveVolumes.AddRange((IEnumerable <int>) this.InactiveVolumes);
     d.PivotRotations.Clear();
     foreach (int key in this.PivotRotations.Keys)
     {
         d.PivotRotations.Add(key, this.PivotRotations[key]);
     }
 }
コード例 #3
0
ファイル: LevelSaveData.cs プロジェクト: Zeludon/FEZ
 public void CloneInto(LevelSaveData d)
 {
   this.FilledConditions.CloneInto(d.FilledConditions);
   d.FirstVisit = this.FirstVisit;
   d.LastStableLiquidHeight = this.LastStableLiquidHeight;
   d.ScriptingState = this.ScriptingState;
   d.DestroyedTriles.Clear();
   d.DestroyedTriles.AddRange((IEnumerable<TrileEmplacement>) this.DestroyedTriles);
   d.InactiveArtObjects.Clear();
   d.InactiveArtObjects.AddRange((IEnumerable<int>) this.InactiveArtObjects);
   d.InactiveEvents.Clear();
   d.InactiveEvents.AddRange((IEnumerable<int>) this.InactiveEvents);
   d.InactiveGroups.Clear();
   d.InactiveGroups.AddRange((IEnumerable<int>) this.InactiveGroups);
   d.InactiveNPCs.Clear();
   d.InactiveNPCs.AddRange((IEnumerable<int>) this.InactiveNPCs);
   d.InactiveTriles.Clear();
   d.InactiveTriles.AddRange((IEnumerable<TrileEmplacement>) this.InactiveTriles);
   d.InactiveVolumes.Clear();
   d.InactiveVolumes.AddRange((IEnumerable<int>) this.InactiveVolumes);
   d.PivotRotations.Clear();
   foreach (int key in this.PivotRotations.Keys)
     d.PivotRotations.Add(key, this.PivotRotations[key]);
 }
コード例 #4
0
ファイル: SaveFileOperations.cs プロジェクト: Zeludon/FEZ
 public static LevelSaveData ReadLevel(CrcReader r)
 {
   LevelSaveData levelSaveData = new LevelSaveData();
   int num1;
   levelSaveData.DestroyedTriles = new List<TrileEmplacement>(num1 = r.ReadInt32());
   for (int index = 0; index < num1; ++index)
     levelSaveData.DestroyedTriles.Add(BinaryWritingTools.ReadTrileEmplacement(r));
   int num2;
   levelSaveData.InactiveTriles = new List<TrileEmplacement>(num2 = r.ReadInt32());
   for (int index = 0; index < num2; ++index)
     levelSaveData.InactiveTriles.Add(BinaryWritingTools.ReadTrileEmplacement(r));
   int num3;
   levelSaveData.InactiveArtObjects = new List<int>(num3 = r.ReadInt32());
   for (int index = 0; index < num3; ++index)
     levelSaveData.InactiveArtObjects.Add(r.ReadInt32());
   int num4;
   levelSaveData.InactiveEvents = new List<int>(num4 = r.ReadInt32());
   for (int index = 0; index < num4; ++index)
     levelSaveData.InactiveEvents.Add(r.ReadInt32());
   int num5;
   levelSaveData.InactiveGroups = new List<int>(num5 = r.ReadInt32());
   for (int index = 0; index < num5; ++index)
     levelSaveData.InactiveGroups.Add(r.ReadInt32());
   int num6;
   levelSaveData.InactiveVolumes = new List<int>(num6 = r.ReadInt32());
   for (int index = 0; index < num6; ++index)
     levelSaveData.InactiveVolumes.Add(r.ReadInt32());
   int num7;
   levelSaveData.InactiveNPCs = new List<int>(num7 = r.ReadInt32());
   for (int index = 0; index < num7; ++index)
     levelSaveData.InactiveNPCs.Add(r.ReadInt32());
   int num8;
   levelSaveData.PivotRotations = new Dictionary<int, int>(num8 = r.ReadInt32());
   for (int index = 0; index < num8; ++index)
     levelSaveData.PivotRotations.Add(r.ReadInt32(), r.ReadInt32());
   levelSaveData.LastStableLiquidHeight = BinaryWritingTools.ReadNullableSingle(r);
   levelSaveData.ScriptingState = BinaryWritingTools.ReadNullableString(r);
   levelSaveData.FirstVisit = r.ReadBoolean();
   levelSaveData.FilledConditions = SaveFileOperations.ReadWonditions(r);
   return levelSaveData;
 }