예제 #1
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("Model", false, out subEle))
            {
                if (Model == null)
                {
                    Model = new Model();
                }

                Model.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("NamedBodyParts", false, out subEle))
            {
                if (NamedBodyParts == null)
                {
                    NamedBodyParts = new List <NamedBodyPart>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    NamedBodyPart tempBPTN = new NamedBodyPart();
                    tempBPTN.ReadXML(e, master);
                    NamedBodyParts.Add(tempBPTN);
                }
            }
            if (ele.TryPathTo("BodyParts", false, out subEle))
            {
                if (BodyParts == null)
                {
                    BodyParts = new List <BodyPart>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    BodyPart tempBPNN = new BodyPart();
                    tempBPNN.ReadXML(e, master);
                    BodyParts.Add(tempBPNN);
                }
            }
            if (ele.TryPathTo("Ragdoll", false, out subEle))
            {
                if (Ragdoll == null)
                {
                    Ragdoll = new RecordReference();
                }

                Ragdoll.ReadXML(subEle, master);
            }
        }
예제 #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 "MODL":
                    if (Model == null)
                    {
                        Model = new Model();
                    }

                    Model.ReadBinary(reader);
                    break;

                case "BPTN":
                    if (NamedBodyParts == null)
                    {
                        NamedBodyParts = new List <NamedBodyPart>();
                    }

                    NamedBodyPart tempBPTN = new NamedBodyPart();
                    tempBPTN.ReadBinary(reader);
                    NamedBodyParts.Add(tempBPTN);
                    break;

                case "BPNN":
                    if (BodyParts == null)
                    {
                        BodyParts = new List <BodyPart>();
                    }

                    BodyPart tempBPNN = new BodyPart();
                    tempBPNN.ReadBinary(reader);
                    BodyParts.Add(tempBPNN);
                    break;

                case "RAGA":
                    if (Ragdoll == null)
                    {
                        Ragdoll = new RecordReference();
                    }

                    Ragdoll.ReadBinary(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }