protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; ele.TryPathTo("Attenuation/Distance/Min", true, out subEle); subEle.Value = MinAttenuationDistance.ToString(); ele.TryPathTo("Attenuation/Distance/Max", true, out subEle); subEle.Value = MaxAttenuationDistance.ToString(); ele.TryPathTo("FrequencyAdjustmentPercentage", true, out subEle); subEle.Value = FrequencyAdjustmentPercentage.ToString(); WriteUnusedXML(ele, master); ele.TryPathTo("Flags", true, out subEle); subEle.Value = SoundDataFlags.ToString(); ele.TryPathTo("Attenuation/StaticAttenuationcdB", true, out subEle); subEle.Value = StaticAttenuationcdB.ToString(); ele.TryPathTo("Time/Stop", true, out subEle); subEle.Value = StopTime.ToString(); ele.TryPathTo("Time/Start", true, out subEle); subEle.Value = StartTime.ToString(); ele.TryPathTo("Attenuation/Curve/Point1", true, out subEle); subEle.Value = AttenuationCurvePoint1.ToString(); ele.TryPathTo("Attenuation/Curve/Point2", true, out subEle); subEle.Value = AttenuationCurvePoint2.ToString(); ele.TryPathTo("Attenuation/Curve/Point3", true, out subEle); subEle.Value = AttenuationCurvePoint3.ToString(); ele.TryPathTo("Attenuation/Curve/Point4", true, out subEle); subEle.Value = AttenuationCurvePoint4.ToString(); ele.TryPathTo("Attenuation/Curve/Point5", true, out subEle); subEle.Value = AttenuationCurvePoint5.ToString(); ele.TryPathTo("Attenuation/ReverbAttenuationControl", true, out subEle); subEle.Value = ReverbAttenuationControl.ToString(); ele.TryPathTo("Priority", true, out subEle); subEle.Value = Priority.ToString(); ele.TryPathTo("Unknown", true, out subEle); subEle.Value = Unknown.ToHex(); }
public override void WriteDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; if (EditorID != null) { ele.TryPathTo("EditorID", true, out subEle); EditorID.WriteXML(subEle, master); } if (ObjectBounds != null) { ele.TryPathTo("ObjectBounds", true, out subEle); ObjectBounds.WriteXML(subEle, master); } if (Filename != null) { ele.TryPathTo("Filename", true, out subEle); Filename.WriteXML(subEle, master); } if (RandomChance != null) { ele.TryPathTo("RandomChance", true, out subEle); RandomChance.WriteXML(subEle, master); } if (SoundData != null) { ele.TryPathTo("SoundData", true, out subEle); SoundData.WriteXML(subEle, master); } if (SoundDataShort != null) { ele.TryPathTo("SoundDataShort", true, out subEle); SoundDataShort.WriteXML(subEle, master); } if (AttenuationCurve != null) { ele.TryPathTo("AttenuationCurve", true, out subEle); AttenuationCurve.WriteXML(subEle, master); } if (ReverbAttenuationControl != null) { ele.TryPathTo("ReverbAttenuationControl", true, out subEle); ReverbAttenuationControl.WriteXML(subEle, master); } if (SoundPriority != null) { ele.TryPathTo("SoundPriority", true, out subEle); SoundPriority.WriteXML(subEle, master); } }
public override void WriteData(ESPWriter writer) { if (EditorID != null) { EditorID.WriteBinary(writer); } if (ObjectBounds != null) { ObjectBounds.WriteBinary(writer); } if (Filename != null) { Filename.WriteBinary(writer); } if (RandomChance != null) { RandomChance.WriteBinary(writer); } if (SoundData != null) { SoundData.WriteBinary(writer); } if (SoundDataShort != null) { SoundDataShort.WriteBinary(writer); } if (AttenuationCurve != null) { AttenuationCurve.WriteBinary(writer); } if (ReverbAttenuationControl != null) { ReverbAttenuationControl.WriteBinary(writer); } if (SoundPriority != null) { SoundPriority.WriteBinary(writer); } }
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 "OBND": if (ObjectBounds == null) { ObjectBounds = new ObjectBounds(); } ObjectBounds.ReadBinary(reader); break; case "FNAM": if (Filename == null) { Filename = new SimpleSubrecord <String>(); } Filename.ReadBinary(reader); break; case "RNAM": if (RandomChance == null) { RandomChance = new SimpleSubrecord <Byte>(); } RandomChance.ReadBinary(reader); break; case "SNDD": if (SoundData == null) { SoundData = new SoundData(); } SoundData.ReadBinary(reader); break; case "SNDX": if (SoundDataShort == null) { SoundDataShort = new SoundDataShort(); } SoundDataShort.ReadBinary(reader); break; case "ANAM": if (AttenuationCurve == null) { AttenuationCurve = new SoundAttenuation(); } AttenuationCurve.ReadBinary(reader); break; case "GNAM": if (ReverbAttenuationControl == null) { ReverbAttenuationControl = new SimpleSubrecord <Int16>(); } ReverbAttenuationControl.ReadBinary(reader); break; case "HNAM": if (SoundPriority == null) { SoundPriority = new SimpleSubrecord <Int32>(); } SoundPriority.ReadBinary(reader); break; default: throw new Exception(); } } }
public override void ReadDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; if (ele.TryPathTo("EditorID", false, out subEle)) { if (EditorID == null) { EditorID = new SimpleSubrecord <String>(); } EditorID.ReadXML(subEle, master); } if (ele.TryPathTo("ObjectBounds", false, out subEle)) { if (ObjectBounds == null) { ObjectBounds = new ObjectBounds(); } ObjectBounds.ReadXML(subEle, master); } if (ele.TryPathTo("Filename", false, out subEle)) { if (Filename == null) { Filename = new SimpleSubrecord <String>(); } Filename.ReadXML(subEle, master); } if (ele.TryPathTo("RandomChance", false, out subEle)) { if (RandomChance == null) { RandomChance = new SimpleSubrecord <Byte>(); } RandomChance.ReadXML(subEle, master); } if (ele.TryPathTo("SoundData", false, out subEle)) { if (SoundData == null) { SoundData = new SoundData(); } SoundData.ReadXML(subEle, master); } if (ele.TryPathTo("SoundDataShort", false, out subEle)) { if (SoundDataShort == null) { SoundDataShort = new SoundDataShort(); } SoundDataShort.ReadXML(subEle, master); } if (ele.TryPathTo("AttenuationCurve", false, out subEle)) { if (AttenuationCurve == null) { AttenuationCurve = new SoundAttenuation(); } AttenuationCurve.ReadXML(subEle, master); } if (ele.TryPathTo("ReverbAttenuationControl", false, out subEle)) { if (ReverbAttenuationControl == null) { ReverbAttenuationControl = new SimpleSubrecord <Int16>(); } ReverbAttenuationControl.ReadXML(subEle, master); } if (ele.TryPathTo("SoundPriority", false, out subEle)) { if (SoundPriority == null) { SoundPriority = new SimpleSubrecord <Int32>(); } SoundPriority.ReadXML(subEle, master); } }