public static void Write(CrcWriter w, SaveData sd) { w.Write(6L); w.Write(sd.CreationTime); w.Write(sd.Finished32); w.Write(sd.Finished64); w.Write(sd.HasFPView); w.Write(sd.HasStereo3D); w.Write(sd.CanNewGamePlus); w.Write(sd.IsNewGamePlus); w.Write(sd.OneTimeTutorials.Count); foreach (KeyValuePair<string, bool> keyValuePair in sd.OneTimeTutorials) { BinaryWritingTools.WriteObject(w, keyValuePair.Key); w.Write(keyValuePair.Value); } BinaryWritingTools.WriteObject(w, sd.Level); w.Write((int) sd.View); BinaryWritingTools.Write(w, sd.Ground); BinaryWritingTools.Write(w, sd.TimeOfDay); w.Write(sd.UnlockedWarpDestinations.Count); foreach (string s in sd.UnlockedWarpDestinations) BinaryWritingTools.WriteObject(w, s); w.Write(sd.Keys); w.Write(sd.CubeShards); w.Write(sd.SecretCubes); w.Write(sd.CollectedParts); w.Write(sd.CollectedOwls); w.Write(sd.PiecesOfHeart); w.Write(sd.Maps.Count); foreach (string s in sd.Maps) BinaryWritingTools.WriteObject(w, s); w.Write(sd.Artifacts.Count); foreach (ActorType actorType in sd.Artifacts) w.Write((int) actorType); w.Write(sd.EarnedAchievements.Count); foreach (string s in sd.EarnedAchievements) BinaryWritingTools.WriteObject(w, s); w.Write(sd.EarnedGamerPictures.Count); foreach (string s in sd.EarnedGamerPictures) BinaryWritingTools.WriteObject(w, s); BinaryWritingTools.WriteObject(w, sd.ScriptingState); w.Write(sd.FezHidden); BinaryWritingTools.WriteObject(w, sd.GlobalWaterLevelModifier); w.Write(sd.HasHadMapHelp); w.Write(sd.CanOpenMap); w.Write(sd.AchievementCheatCodeDone); w.Write(sd.AnyCodeDeciphered); w.Write(sd.MapCheatCodeDone); w.Write(sd.World.Count); foreach (KeyValuePair<string, LevelSaveData> keyValuePair in sd.World) { BinaryWritingTools.WriteObject(w, keyValuePair.Key); SaveFileOperations.Write(w, keyValuePair.Value); } w.Write(sd.ScoreDirty); w.Write(sd.HasDoneHeartReboot); w.Write(sd.PlayTime); w.Write(sd.IsNew); }
public virtual void SaveWrite(SaveData saveData, CrcWriter writer) { }
public virtual void SaveRead(SaveData saveData, CrcReader reader) { }
public virtual void SaveClone(SaveData source, SaveData dest) { }
public virtual void SaveClear(SaveData saveData) { }
public void orig_CloneInto(SaveData d) { }
public void CloneInto(SaveData d) { orig_CloneInto(d); FEZMod.SaveClone(this, d); }
public void CloneInto(SaveData d) { d.AchievementCheatCodeDone = this.AchievementCheatCodeDone; d.AnyCodeDeciphered = this.AnyCodeDeciphered; d.CanNewGamePlus = this.CanNewGamePlus; d.CanOpenMap = this.CanOpenMap; d.CollectedOwls = this.CollectedOwls; d.CollectedParts = this.CollectedParts; d.CreationTime = this.CreationTime; d.CubeShards = this.CubeShards; d.FezHidden = this.FezHidden; d.Finished32 = this.Finished32; d.Finished64 = this.Finished64; d.GlobalWaterLevelModifier = this.GlobalWaterLevelModifier; d.Ground = this.Ground; d.HasDoneHeartReboot = this.HasDoneHeartReboot; d.HasFPView = this.HasFPView; d.HasHadMapHelp = this.HasHadMapHelp; d.HasStereo3D = this.HasStereo3D; d.IsNew = this.IsNew; d.IsNewGamePlus = this.IsNewGamePlus; d.Keys = this.Keys; d.Level = this.Level; d.MapCheatCodeDone = this.MapCheatCodeDone; d.PiecesOfHeart = this.PiecesOfHeart; d.PlayTime = this.PlayTime; d.ScoreDirty = this.ScoreDirty; d.ScriptingState = this.ScriptingState; d.SecretCubes = this.SecretCubes; d.SinceLastSaved = this.SinceLastSaved; d.TimeOfDay = this.TimeOfDay; d.View = this.View; try { d.Artifacts.Clear(); d.Artifacts.AddRange((IEnumerable<ActorType>) this.Artifacts); d.EarnedAchievements.Clear(); d.EarnedAchievements.AddRange((IEnumerable<string>) this.EarnedAchievements); d.EarnedGamerPictures.Clear(); d.EarnedGamerPictures.AddRange((IEnumerable<string>) this.EarnedGamerPictures); d.Maps.Clear(); d.Maps.AddRange((IEnumerable<string>) this.Maps); d.UnlockedWarpDestinations.Clear(); d.UnlockedWarpDestinations.AddRange((IEnumerable<string>) this.UnlockedWarpDestinations); d.OneTimeTutorials.Clear(); foreach (string key in this.OneTimeTutorials.Keys) d.OneTimeTutorials.Add(key, this.OneTimeTutorials[key]); foreach (string key in this.World.Keys) { if (!d.World.ContainsKey(key)) d.World.Add(key, new LevelSaveData()); this.World[key].CloneInto(d.World[key]); } foreach (string key in d.World.Keys) { if (!this.World.ContainsKey(key)) d.World.Remove(key); } } catch (InvalidOperationException ex) { this.CloneInto(d); } }
public static SaveData Read(CrcReader r) { SaveData saveData = new SaveData(); long num1 = r.ReadInt64(); if (num1 != 6L) { throw new IOException("Invalid version : " + (object) num1 + " (expected " + (string) (object) 6 + ")"); } else { saveData.CreationTime = r.ReadInt64(); saveData.Finished32 = r.ReadBoolean(); saveData.Finished64 = r.ReadBoolean(); saveData.HasFPView = r.ReadBoolean(); saveData.HasStereo3D = r.ReadBoolean(); saveData.CanNewGamePlus = r.ReadBoolean(); saveData.IsNewGamePlus = r.ReadBoolean(); saveData.OneTimeTutorials.Clear(); int num2; saveData.OneTimeTutorials = new Dictionary<string, bool>(num2 = r.ReadInt32()); for (int index = 0; index < num2; ++index) saveData.OneTimeTutorials.Add(BinaryWritingTools.ReadNullableString(r), r.ReadBoolean()); saveData.Level = BinaryWritingTools.ReadNullableString(r); saveData.View = (Viewpoint) r.ReadInt32(); saveData.Ground = BinaryWritingTools.ReadVector3(r); saveData.TimeOfDay = BinaryWritingTools.ReadTimeSpan(r); int num3; saveData.UnlockedWarpDestinations = new List<string>(num3 = r.ReadInt32()); for (int index = 0; index < num3; ++index) saveData.UnlockedWarpDestinations.Add(BinaryWritingTools.ReadNullableString(r)); saveData.Keys = r.ReadInt32(); saveData.CubeShards = r.ReadInt32(); saveData.SecretCubes = r.ReadInt32(); saveData.CollectedParts = r.ReadInt32(); saveData.CollectedOwls = r.ReadInt32(); saveData.PiecesOfHeart = r.ReadInt32(); if (saveData.SecretCubes > 32 || saveData.CubeShards > 32 || saveData.PiecesOfHeart > 3) saveData.ScoreDirty = true; saveData.SecretCubes = Math.Min(saveData.SecretCubes, 32); saveData.CubeShards = Math.Min(saveData.CubeShards, 32); saveData.PiecesOfHeart = Math.Min(saveData.PiecesOfHeart, 3); int num4; saveData.Maps = new List<string>(num4 = r.ReadInt32()); for (int index = 0; index < num4; ++index) saveData.Maps.Add(BinaryWritingTools.ReadNullableString(r)); int num5; saveData.Artifacts = new List<ActorType>(num5 = r.ReadInt32()); for (int index = 0; index < num5; ++index) saveData.Artifacts.Add((ActorType) r.ReadInt32()); int num6; saveData.EarnedAchievements = new List<string>(num6 = r.ReadInt32()); for (int index = 0; index < num6; ++index) saveData.EarnedAchievements.Add(BinaryWritingTools.ReadNullableString(r)); int num7; saveData.EarnedGamerPictures = new List<string>(num7 = r.ReadInt32()); for (int index = 0; index < num7; ++index) saveData.EarnedGamerPictures.Add(BinaryWritingTools.ReadNullableString(r)); saveData.ScriptingState = BinaryWritingTools.ReadNullableString(r); saveData.FezHidden = r.ReadBoolean(); saveData.GlobalWaterLevelModifier = BinaryWritingTools.ReadNullableSingle(r); saveData.HasHadMapHelp = r.ReadBoolean(); saveData.CanOpenMap = r.ReadBoolean(); saveData.AchievementCheatCodeDone = r.ReadBoolean(); saveData.AnyCodeDeciphered = r.ReadBoolean(); saveData.MapCheatCodeDone = r.ReadBoolean(); int num8; saveData.World = new Dictionary<string, LevelSaveData>(num8 = r.ReadInt32()); for (int index = 0; index < num8; ++index) { try { saveData.World.Add(BinaryWritingTools.ReadNullableString(r), SaveFileOperations.ReadLevel(r)); } catch (Exception ex) { break; } } r.ReadBoolean(); saveData.ScoreDirty = true; saveData.HasDoneHeartReboot = r.ReadBoolean(); saveData.PlayTime = r.ReadInt64(); saveData.IsNew = string.IsNullOrEmpty(saveData.Level) || saveData.Level == "GOMEZ_HOUSE_2D"; return saveData; } }
public static void Write(CrcWriter w, SaveData sd) { orig_Write(w, sd); FEZMod.SaveWrite(sd, w); }
public static void orig_Write(CrcWriter w, SaveData sd) { }