Пример #1
0
 public Sound(SimpleSubrecord <String> EditorID, ObjectBounds ObjectBounds, SimpleSubrecord <String> Filename, SimpleSubrecord <Byte> RandomChance, SoundData SoundData, SoundDataShort SoundDataShort, SoundAttenuation AttenuationCurve, SimpleSubrecord <Int16> ReverbAttenuationControl, SimpleSubrecord <Int32> SoundPriority)
 {
     this.EditorID     = EditorID;
     this.ObjectBounds = ObjectBounds;
 }
Пример #2
0
        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();
                }
            }
        }
Пример #3
0
        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);
            }
        }