protected override void ReadData(ESPReader reader) { using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size))) using (ESPReader subReader = new ESPReader(stream, reader.Plugin)) { try { Unknown1.ReadBinary(subReader); Int32 Unknown2Count = subReader.ReadInt32(); for (int i = 0; i < Unknown2Count; i++) { var temp = new FormID(); temp.ReadBinary(subReader); Unknown2.Add(temp); } Int32 Unknown3Count = subReader.ReadInt32(); for (int i = 0; i < Unknown3Count; i++) { var temp = new FormID(); temp.ReadBinary(subReader); Unknown3.Add(temp); } Int32 DoorsCount = subReader.ReadInt32(); for (int i = 0; i < DoorsCount; i++) { var temp = new FormID(); temp.ReadBinary(subReader); Doors.Add(temp); } } catch { return; } } }
public override void ReadBinary(ESPReader reader) { List <string> readTags = new List <string>(); readTags.Add(reader.PeekTag()); Marker.ReadBinary(reader); while (reader.BaseStream.Position < reader.BaseStream.Length) { string subTag = reader.PeekTag(); switch (subTag) { case "FULL": if (readTags.Contains("FULL")) { return; } if (Unknown1 == null) { Unknown1 = new SimpleSubrecord <Byte[]>(); } Unknown1.ReadBinary(reader); break; case "CNAM": if (readTags.Contains("CNAM")) { return; } if (AudioLocation == null) { AudioLocation = new RecordReference(); } AudioLocation.ReadBinary(reader); break; case "BNAM": if (readTags.Contains("BNAM")) { return; } if (Unknown2 == null) { Unknown2 = new SimpleSubrecord <Byte[]>(); } Unknown2.ReadBinary(reader); break; case "MNAM": if (readTags.Contains("MNAM")) { return; } if (Unknown3 == null) { Unknown3 = new SimpleSubrecord <Single>(); } Unknown3.ReadBinary(reader); break; case "NNAM": if (readTags.Contains("NNAM")) { return; } if (Unknown4 == null) { Unknown4 = new SimpleSubrecord <Single>(); } Unknown4.ReadBinary(reader); break; default: return; } readTags.Add(subTag); } }
public override void ReadData(ESPReader reader, long dataEnd) { while (reader.BaseStream.Position < dataEnd) { string subTag = reader.PeekTag(); switch (subTag) { case "EDID": if (EditorID == null) { EditorID = new SimpleSubrecord <String>(); } EditorID.ReadBinary(reader); break; case "FULL": if (Name == null) { Name = new SimpleSubrecord <String>(); } Name.ReadBinary(reader); break; case "NAM1": if (Unknown1 == null) { Unknown1 = new SimpleSubrecord <Byte[]>(); } Unknown1.ReadBinary(reader); break; case "NAM2": if (Unknown2 == null) { Unknown2 = new SimpleSubrecord <Byte[]>(); } Unknown2.ReadBinary(reader); break; case "NAM3": if (Unknown3 == null) { Unknown3 = new SimpleSubrecord <Byte[]>(); } Unknown3.ReadBinary(reader); break; case "NAM4": if (LocationDelay == null) { LocationDelay = new SimpleSubrecord <Single>(); } LocationDelay.ReadBinary(reader); break; case "NAM5": if (DayStart == null) { DayStart = new SimpleSubrecord <UInt32>(); } DayStart.ReadBinary(reader); break; case "NAM6": if (NightStart == null) { NightStart = new SimpleSubrecord <UInt32>(); } NightStart.ReadBinary(reader); break; case "NAM7": if (RetriggerDelay == null) { RetriggerDelay = new SimpleSubrecord <Single>(); } RetriggerDelay.ReadBinary(reader); break; case "HNAM": if (MediaSetsNeutral == null) { MediaSetsNeutral = new List <RecordReference>(); } RecordReference tempHNAM = new RecordReference(); tempHNAM.ReadBinary(reader); MediaSetsNeutral.Add(tempHNAM); break; case "ZNAM": if (MediaSetsAlly == null) { MediaSetsAlly = new List <RecordReference>(); } RecordReference tempZNAM = new RecordReference(); tempZNAM.ReadBinary(reader); MediaSetsAlly.Add(tempZNAM); break; case "XNAM": if (MediaSetsFriend == null) { MediaSetsFriend = new List <RecordReference>(); } RecordReference tempXNAM = new RecordReference(); tempXNAM.ReadBinary(reader); MediaSetsFriend.Add(tempXNAM); break; case "YNAM": if (MediaSetsEnemy == null) { MediaSetsEnemy = new List <RecordReference>(); } RecordReference tempYNAM = new RecordReference(); tempYNAM.ReadBinary(reader); MediaSetsEnemy.Add(tempYNAM); break; case "LNAM": if (MediaSetsLocation == null) { MediaSetsLocation = new List <RecordReference>(); } RecordReference tempLNAM = new RecordReference(); tempLNAM.ReadBinary(reader); MediaSetsLocation.Add(tempLNAM); break; case "GNAM": if (MediaSetsBattle == null) { MediaSetsBattle = new List <RecordReference>(); } RecordReference tempGNAM = new RecordReference(); tempGNAM.ReadBinary(reader); MediaSetsBattle.Add(tempGNAM); break; case "RNAM": if (ConditionalFaction == null) { ConditionalFaction = new RecordReference(); } ConditionalFaction.ReadBinary(reader); break; case "FNAM": if (Unknown4 == null) { Unknown4 = new SimpleSubrecord <Byte[]>(); } Unknown4.ReadBinary(reader); break; default: throw new Exception(); } } }