コード例 #1
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (LargeIcon != null)
     {
         LargeIcon.WriteBinary(writer);
     }
     if (SmallIcon != null)
     {
         SmallIcon.WriteBinary(writer);
     }
     if (TextureSet != null)
     {
         TextureSet.WriteBinary(writer);
     }
     if (HavokData != null)
     {
         HavokData.WriteBinary(writer);
     }
     if (TextureSpecularExponent != null)
     {
         TextureSpecularExponent.WriteBinary(writer);
     }
     if (Grasses != null)
     {
         foreach (var item in Grasses)
         {
             item.WriteBinary(writer);
         }
     }
 }
コード例 #2
0
        public override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (EditorID != null)
            {
                ele.TryPathTo("EditorID", true, out subEle);
                EditorID.WriteXML(subEle, master);
            }
            if (LargeIcon != null)
            {
                ele.TryPathTo("Icon/Large", true, out subEle);
                LargeIcon.WriteXML(subEle, master);
            }
            if (SmallIcon != null)
            {
                ele.TryPathTo("Icon/Small", true, out subEle);
                SmallIcon.WriteXML(subEle, master);
            }
            if (TextureSet != null)
            {
                ele.TryPathTo("TextureSet", true, out subEle);
                TextureSet.WriteXML(subEle, master);
            }
            if (HavokData != null)
            {
                ele.TryPathTo("HavokData", true, out subEle);
                HavokData.WriteXML(subEle, master);
            }
            if (TextureSpecularExponent != null)
            {
                ele.TryPathTo("TextureSpecularExponent", true, out subEle);
                TextureSpecularExponent.WriteXML(subEle, master);
            }
            if (Grasses != null)
            {
                ele.TryPathTo("Grasses", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "Grass"
                };
                int i = 0;
                foreach (var entry in Grasses)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
        }
コード例 #3
0
        public override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (EditorID != null)
            {
                ele.TryPathTo("EditorID", true, out subEle);
                EditorID.WriteXML(subEle, master);
            }
            if (Model != null)
            {
                ele.TryPathTo("Model", true, out subEle);
                Model.WriteXML(subEle, master);
            }
            if (Data != null)
            {
                ele.TryPathTo("Data", true, out subEle);
                Data.WriteXML(subEle, master);
            }
            if (DecalData != null)
            {
                ele.TryPathTo("DecalData", true, out subEle);
                DecalData.WriteXML(subEle, master);
            }
            if (TextureSet != null)
            {
                ele.TryPathTo("TextureSet", true, out subEle);
                TextureSet.WriteXML(subEle, master);
            }
            if (Sound1 != null)
            {
                ele.TryPathTo("Sound1", true, out subEle);
                Sound1.WriteXML(subEle, master);
            }
            if (Sound2 != null)
            {
                ele.TryPathTo("Sound2", true, out subEle);
                Sound2.WriteXML(subEle, master);
            }
        }
コード例 #4
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 "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();
                }
            }
        }
コード例 #5
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("Data", false, out subEle))
            {
                if (Data == null)
                {
                    Data = new ImpactData();
                }

                Data.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("DecalData", false, out subEle))
            {
                if (DecalData == null)
                {
                    DecalData = new DecalData();
                }

                DecalData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("TextureSet", false, out subEle))
            {
                if (TextureSet == null)
                {
                    TextureSet = new RecordReference();
                }

                TextureSet.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Sound1", false, out subEle))
            {
                if (Sound1 == null)
                {
                    Sound1 = new RecordReference();
                }

                Sound1.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Sound2", false, out subEle))
            {
                if (Sound2 == null)
                {
                    Sound2 = new RecordReference();
                }

                Sound2.ReadXML(subEle, master);
            }
        }
コード例 #6
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 "ICON":
                    if (LargeIcon == null)
                    {
                        LargeIcon = new SimpleSubrecord <String>();
                    }

                    LargeIcon.ReadBinary(reader);
                    break;

                case "MICO":
                    if (SmallIcon == null)
                    {
                        SmallIcon = new SimpleSubrecord <String>();
                    }

                    SmallIcon.ReadBinary(reader);
                    break;

                case "TNAM":
                    if (TextureSet == null)
                    {
                        TextureSet = new RecordReference();
                    }

                    TextureSet.ReadBinary(reader);
                    break;

                case "HNAM":
                    if (HavokData == null)
                    {
                        HavokData = new HavokData();
                    }

                    HavokData.ReadBinary(reader);
                    break;

                case "SNAM":
                    if (TextureSpecularExponent == null)
                    {
                        TextureSpecularExponent = new SimpleSubrecord <Byte>();
                    }

                    TextureSpecularExponent.ReadBinary(reader);
                    break;

                case "GNAM":
                    if (Grasses == null)
                    {
                        Grasses = new List <RecordReference>();
                    }

                    RecordReference tempGNAM = new RecordReference();
                    tempGNAM.ReadBinary(reader);
                    Grasses.Add(tempGNAM);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
コード例 #7
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("Icon/Large", false, out subEle))
            {
                if (LargeIcon == null)
                {
                    LargeIcon = new SimpleSubrecord <String>();
                }

                LargeIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Small", false, out subEle))
            {
                if (SmallIcon == null)
                {
                    SmallIcon = new SimpleSubrecord <String>();
                }

                SmallIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("TextureSet", false, out subEle))
            {
                if (TextureSet == null)
                {
                    TextureSet = new RecordReference();
                }

                TextureSet.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("HavokData", false, out subEle))
            {
                if (HavokData == null)
                {
                    HavokData = new HavokData();
                }

                HavokData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("TextureSpecularExponent", false, out subEle))
            {
                if (TextureSpecularExponent == null)
                {
                    TextureSpecularExponent = new SimpleSubrecord <Byte>();
                }

                TextureSpecularExponent.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Grasses", false, out subEle))
            {
                if (Grasses == null)
                {
                    Grasses = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempGNAM = new RecordReference();
                    tempGNAM.ReadXML(e, master);
                    Grasses.Add(tempGNAM);
                }
            }
        }
コード例 #8
0
 public TextureSet(TextureSet copyObject)
 {
 }