public override void ReadBinary(ESPReader reader) { List <string> readTags = new List <string>(); while (reader.BaseStream.Position < reader.BaseStream.Length) { string subTag = reader.PeekTag(); switch (subTag) { case "ITXT": if (readTags.Contains("ITXT")) { return; } ItemText.ReadBinary(reader); break; case "RNAM": if (readTags.Contains("RNAM")) { return; } ResultText.ReadBinary(reader); break; case "ANAM": if (readTags.Contains("ANAM")) { return; } Flags.ReadBinary(reader); break; case "INAM": if (readTags.Contains("INAM")) { return; } if (DisplayNote == null) { DisplayNote = new RecordReference(); } DisplayNote.ReadBinary(reader); break; case "TNAM": if (readTags.Contains("TNAM")) { return; } if (SubMenu == null) { SubMenu = new RecordReference(); } SubMenu.ReadBinary(reader); break; case "SCHR": if (readTags.Contains("SCHR")) { return; } if (Script == null) { Script = new EmbeddedScript(); } Script.ReadBinary(reader); break; case "CTDA": if (Conditions == null) { Conditions = new List <Condition>(); } Condition tempCTDA = new Condition(); tempCTDA.ReadBinary(reader); Conditions.Add(tempCTDA); break; default: return; } readTags.Add(subTag); } }