public static SaveData Read(CrcReader r) { SaveData sd = orig_Read(r); r.ReadBoolean();//Write writes isNew but Read ignores it. FEZMod.SaveRead(sd, r); return sd; }
public static float?ReadNullableSingle(this CrcReader reader) { if (reader.ReadBoolean()) { return(new float?(reader.ReadSingle())); } else { return(new float?()); } }
public static string ReadNullableString(this CrcReader reader) { if (reader.ReadBoolean()) { return(reader.ReadString()); } else { return((string)null); } }
public static TrileEmplacement ReadTrileEmplacement(this CrcReader reader) { return(new TrileEmplacement(reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32())); }
public static TimeSpan ReadTimeSpan(this CrcReader reader) { return(new TimeSpan(reader.ReadInt64())); }
public static Vector3 ReadVector3(this CrcReader reader) { return(new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle())); }
public virtual void SaveRead(SaveData saveData, CrcReader reader) { }
public static WinConditions ReadWonditions(CrcReader r) { WinConditions winConditions = new WinConditions(); winConditions.LockedDoorCount = r.ReadInt32(); winConditions.UnlockedDoorCount = r.ReadInt32(); winConditions.ChestCount = r.ReadInt32(); winConditions.CubeShardCount = r.ReadInt32(); winConditions.OtherCollectibleCount = r.ReadInt32(); winConditions.SplitUpCount = r.ReadInt32(); int num; winConditions.ScriptIds = new List<int>(num = r.ReadInt32()); for (int index = 0; index < num; ++index) winConditions.ScriptIds.Add(r.ReadInt32()); winConditions.SecretCount = r.ReadInt32(); return winConditions; }
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; }
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 SaveData orig_Read(CrcReader r) { return null; }