protected override void ReadData(ESPReader reader) { using (MemoryStream stream = new MemoryStream(reader.ReadBytes(size))) using (ESPReader subReader = new ESPReader(stream, reader.Plugin)) { try { Force = subReader.ReadSingle(); Damage = subReader.ReadSingle(); Radius = subReader.ReadSingle(); Light.ReadBinary(subReader); Sound1.ReadBinary(subReader); Flags = subReader.ReadEnum <ExplosionFlags>(); ISRadius = subReader.ReadSingle(); ImpactDataSet.ReadBinary(subReader); Sound2.ReadBinary(subReader); RadiationLevel = subReader.ReadSingle(); RadiationDissipationTime = subReader.ReadSingle(); RadiationRadius = subReader.ReadSingle(); SoundLevel = subReader.ReadEnum <SoundLevel>(); } catch { return; } } }
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 "MODL": if (Model == null) { Model = new Model(); } Model.ReadBinary(reader); break; case "DATA": if (Data == null) { Data = new ImpactData(); } Data.ReadBinary(reader); break; case "DODT": if (DecalData == null) { DecalData = new DecalData(); } DecalData.ReadBinary(reader); break; case "DNAM": if (TextureSet == null) { TextureSet = new RecordReference(); } TextureSet.ReadBinary(reader); break; case "SNAM": if (Sound1 == null) { Sound1 = new RecordReference(); } Sound1.ReadBinary(reader); break; case "NAM1": if (Sound2 == null) { Sound2 = new RecordReference(); } Sound2.ReadBinary(reader); break; default: throw new Exception(); } } }