Exemple #1
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 (Name != null)
            {
                ele.TryPathTo("Name", true, out subEle);
                Name.WriteXML(subEle, master);
            }
            if (Unknown1 != null)
            {
                ele.TryPathTo("Unknown1", true, out subEle);
                Unknown1.WriteXML(subEle, master);
            }
            if (Unknown2 != null)
            {
                ele.TryPathTo("Unknown2", true, out subEle);
                Unknown2.WriteXML(subEle, master);
            }
            if (Unknown3 != null)
            {
                ele.TryPathTo("Unknown3", true, out subEle);
                Unknown3.WriteXML(subEle, master);
            }
            if (LocationDelay != null)
            {
                ele.TryPathTo("LocationDelay", true, out subEle);
                LocationDelay.WriteXML(subEle, master);
            }
            if (DayStart != null)
            {
                ele.TryPathTo("DayStart", true, out subEle);
                DayStart.WriteXML(subEle, master);
            }
            if (NightStart != null)
            {
                ele.TryPathTo("NightStart", true, out subEle);
                NightStart.WriteXML(subEle, master);
            }
            if (RetriggerDelay != null)
            {
                ele.TryPathTo("RetriggerDelay", true, out subEle);
                RetriggerDelay.WriteXML(subEle, master);
            }
            if (MediaSetsNeutral != null)
            {
                ele.TryPathTo("MediaSets/Neutral", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "MediaSet"
                };
                int i = 0;
                MediaSetsNeutral.Sort();
                foreach (var entry in MediaSetsNeutral)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (MediaSetsAlly != null)
            {
                ele.TryPathTo("MediaSets/Ally", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "MediaSet"
                };
                int i = 0;
                MediaSetsAlly.Sort();
                foreach (var entry in MediaSetsAlly)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (MediaSetsFriend != null)
            {
                ele.TryPathTo("MediaSets/Friend", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "MediaSet"
                };
                int i = 0;
                MediaSetsFriend.Sort();
                foreach (var entry in MediaSetsFriend)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (MediaSetsEnemy != null)
            {
                ele.TryPathTo("MediaSets/Enemy", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "MediaSet"
                };
                int i = 0;
                MediaSetsEnemy.Sort();
                foreach (var entry in MediaSetsEnemy)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (MediaSetsLocation != null)
            {
                ele.TryPathTo("MediaSets/Location", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "MediaSet"
                };
                int i = 0;
                MediaSetsLocation.Sort();
                foreach (var entry in MediaSetsLocation)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (MediaSetsBattle != null)
            {
                ele.TryPathTo("MediaSets/Battle", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "MediaSet"
                };
                int i = 0;
                MediaSetsBattle.Sort();
                foreach (var entry in MediaSetsBattle)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (ConditionalFaction != null)
            {
                ele.TryPathTo("ConditionalFaction", true, out subEle);
                ConditionalFaction.WriteXML(subEle, master);
            }
            if (Unknown4 != null)
            {
                ele.TryPathTo("Unknown4", true, out subEle);
                Unknown4.WriteXML(subEle, master);
            }
        }
Exemple #2
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (Name != null)
     {
         Name.WriteBinary(writer);
     }
     if (Unknown1 != null)
     {
         Unknown1.WriteBinary(writer);
     }
     if (Unknown2 != null)
     {
         Unknown2.WriteBinary(writer);
     }
     if (Unknown3 != null)
     {
         Unknown3.WriteBinary(writer);
     }
     if (LocationDelay != null)
     {
         LocationDelay.WriteBinary(writer);
     }
     if (DayStart != null)
     {
         DayStart.WriteBinary(writer);
     }
     if (NightStart != null)
     {
         NightStart.WriteBinary(writer);
     }
     if (RetriggerDelay != null)
     {
         RetriggerDelay.WriteBinary(writer);
     }
     if (MediaSetsNeutral != null)
     {
         MediaSetsNeutral.Sort();
         foreach (var item in MediaSetsNeutral)
         {
             item.WriteBinary(writer);
         }
     }
     if (MediaSetsAlly != null)
     {
         MediaSetsAlly.Sort();
         foreach (var item in MediaSetsAlly)
         {
             item.WriteBinary(writer);
         }
     }
     if (MediaSetsFriend != null)
     {
         MediaSetsFriend.Sort();
         foreach (var item in MediaSetsFriend)
         {
             item.WriteBinary(writer);
         }
     }
     if (MediaSetsEnemy != null)
     {
         MediaSetsEnemy.Sort();
         foreach (var item in MediaSetsEnemy)
         {
             item.WriteBinary(writer);
         }
     }
     if (MediaSetsLocation != null)
     {
         MediaSetsLocation.Sort();
         foreach (var item in MediaSetsLocation)
         {
             item.WriteBinary(writer);
         }
     }
     if (MediaSetsBattle != null)
     {
         MediaSetsBattle.Sort();
         foreach (var item in MediaSetsBattle)
         {
             item.WriteBinary(writer);
         }
     }
     if (ConditionalFaction != null)
     {
         ConditionalFaction.WriteBinary(writer);
     }
     if (Unknown4 != null)
     {
         Unknown4.WriteBinary(writer);
     }
 }