示例#1
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 "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();
                }
            }
        }
示例#2
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("Name", false, out subEle))
            {
                if (Name == null)
                {
                    Name = new SimpleSubrecord <String>();
                }

                Name.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unknown1", false, out subEle))
            {
                if (Unknown1 == null)
                {
                    Unknown1 = new SimpleSubrecord <Byte[]>();
                }

                Unknown1.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unknown2", false, out subEle))
            {
                if (Unknown2 == null)
                {
                    Unknown2 = new SimpleSubrecord <Byte[]>();
                }

                Unknown2.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unknown3", false, out subEle))
            {
                if (Unknown3 == null)
                {
                    Unknown3 = new SimpleSubrecord <Byte[]>();
                }

                Unknown3.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("LocationDelay", false, out subEle))
            {
                if (LocationDelay == null)
                {
                    LocationDelay = new SimpleSubrecord <Single>();
                }

                LocationDelay.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("DayStart", false, out subEle))
            {
                if (DayStart == null)
                {
                    DayStart = new SimpleSubrecord <UInt32>();
                }

                DayStart.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("NightStart", false, out subEle))
            {
                if (NightStart == null)
                {
                    NightStart = new SimpleSubrecord <UInt32>();
                }

                NightStart.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("RetriggerDelay", false, out subEle))
            {
                if (RetriggerDelay == null)
                {
                    RetriggerDelay = new SimpleSubrecord <Single>();
                }

                RetriggerDelay.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("MediaSets/Neutral", false, out subEle))
            {
                if (MediaSetsNeutral == null)
                {
                    MediaSetsNeutral = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempHNAM = new RecordReference();
                    tempHNAM.ReadXML(e, master);
                    MediaSetsNeutral.Add(tempHNAM);
                }
            }
            if (ele.TryPathTo("MediaSets/Ally", false, out subEle))
            {
                if (MediaSetsAlly == null)
                {
                    MediaSetsAlly = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempZNAM = new RecordReference();
                    tempZNAM.ReadXML(e, master);
                    MediaSetsAlly.Add(tempZNAM);
                }
            }
            if (ele.TryPathTo("MediaSets/Friend", false, out subEle))
            {
                if (MediaSetsFriend == null)
                {
                    MediaSetsFriend = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempXNAM = new RecordReference();
                    tempXNAM.ReadXML(e, master);
                    MediaSetsFriend.Add(tempXNAM);
                }
            }
            if (ele.TryPathTo("MediaSets/Enemy", false, out subEle))
            {
                if (MediaSetsEnemy == null)
                {
                    MediaSetsEnemy = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempYNAM = new RecordReference();
                    tempYNAM.ReadXML(e, master);
                    MediaSetsEnemy.Add(tempYNAM);
                }
            }
            if (ele.TryPathTo("MediaSets/Location", false, out subEle))
            {
                if (MediaSetsLocation == null)
                {
                    MediaSetsLocation = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempLNAM = new RecordReference();
                    tempLNAM.ReadXML(e, master);
                    MediaSetsLocation.Add(tempLNAM);
                }
            }
            if (ele.TryPathTo("MediaSets/Battle", false, out subEle))
            {
                if (MediaSetsBattle == null)
                {
                    MediaSetsBattle = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempGNAM = new RecordReference();
                    tempGNAM.ReadXML(e, master);
                    MediaSetsBattle.Add(tempGNAM);
                }
            }
            if (ele.TryPathTo("ConditionalFaction", false, out subEle))
            {
                if (ConditionalFaction == null)
                {
                    ConditionalFaction = new RecordReference();
                }

                ConditionalFaction.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unknown4", false, out subEle))
            {
                if (Unknown4 == null)
                {
                    Unknown4 = new SimpleSubrecord <Byte[]>();
                }

                Unknown4.ReadXML(subEle, master);
            }
        }