示例#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 (ObjectBounds != null)
            {
                ele.TryPathTo("ObjectBounds", true, out subEle);
                ObjectBounds.WriteXML(subEle, master);
            }
            if (Name != null)
            {
                ele.TryPathTo("Name", true, out subEle);
                Name.WriteXML(subEle, master);
            }
            if (Model != null)
            {
                ele.TryPathTo("Model", true, out subEle);
                Model.WriteXML(subEle, master);
            }
            if (BaseStats != null)
            {
                ele.TryPathTo("BaseStats", true, out subEle);
                BaseStats.WriteXML(subEle, master);
            }
            if (Factions != null)
            {
                ele.TryPathTo("Factions", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "Faction"
                };
                int i = 0;
                Factions.Sort();
                foreach (var entry in Factions)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (DeathItem != null)
            {
                ele.TryPathTo("DeathItem", true, out subEle);
                DeathItem.WriteXML(subEle, master);
            }
            if (VoiceType != null)
            {
                ele.TryPathTo("VoiceType", true, out subEle);
                VoiceType.WriteXML(subEle, master);
            }
            if (Template != null)
            {
                ele.TryPathTo("Template", true, out subEle);
                Template.WriteXML(subEle, master);
            }
            if (Race != null)
            {
                ele.TryPathTo("Race", true, out subEle);
                Race.WriteXML(subEle, master);
            }
            if (ActorEffects != null)
            {
                ele.TryPathTo("ActorEffects", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "ActorEffect"
                };
                int i = 0;
                ActorEffects.Sort();
                foreach (var entry in ActorEffects)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (UnarmedAttackEffect != null)
            {
                ele.TryPathTo("Unarmed/AttackEffect", true, out subEle);
                UnarmedAttackEffect.WriteXML(subEle, master);
            }
            if (UnarmedAttackAnimation != null)
            {
                ele.TryPathTo("Unarmed/AttackAnimation", true, out subEle);
                UnarmedAttackAnimation.WriteXML(subEle, master);
            }
            if (Destructable != null)
            {
                ele.TryPathTo("Destructable", true, out subEle);
                Destructable.WriteXML(subEle, master);
            }
            if (Script != null)
            {
                ele.TryPathTo("Script", true, out subEle);
                Script.WriteXML(subEle, master);
            }
            if (Contents != null)
            {
                ele.TryPathTo("Contents", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "Item"
                };
                int i = 0;
                Contents.Sort();
                foreach (var entry in Contents)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (AIData != null)
            {
                ele.TryPathTo("AIData", true, out subEle);
                AIData.WriteXML(subEle, master);
            }
            if (Packages != null)
            {
                ele.TryPathTo("Packages", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "Package"
                };
                int i = 0;
                foreach (var entry in Packages)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (Class != null)
            {
                ele.TryPathTo("Class", true, out subEle);
                Class.WriteXML(subEle, master);
            }
            if (Data != null)
            {
                ele.TryPathTo("Data", true, out subEle);
                Data.WriteXML(subEle, master);
            }
            if (Skills != null)
            {
                ele.TryPathTo("Skills", true, out subEle);
                Skills.WriteXML(subEle, master);
            }
            if (HeadParts != null)
            {
                ele.TryPathTo("HeadParts", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "HeadPart"
                };
                int i = 0;
                HeadParts.Sort();
                foreach (var entry in HeadParts)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (HairType != null)
            {
                ele.TryPathTo("Hair/Type", true, out subEle);
                HairType.WriteXML(subEle, master);
            }
            if (HairLength != null)
            {
                ele.TryPathTo("Hair/Length", true, out subEle);
                HairLength.WriteXML(subEle, master);
            }
            if (Eyes != null)
            {
                ele.TryPathTo("Eyes", true, out subEle);
                Eyes.WriteXML(subEle, master);
            }
            if (HairColor != null)
            {
                ele.TryPathTo("Hair/Color", true, out subEle);
                HairColor.WriteXML(subEle, master);
            }
            if (CombatStyle != null)
            {
                ele.TryPathTo("CombatStyle", true, out subEle);
                CombatStyle.WriteXML(subEle, master);
            }
            if (ImpactMaterialType != null)
            {
                ele.TryPathTo("ImpactMaterialType", true, out subEle);
                ImpactMaterialType.WriteXML(subEle, master);
            }
            if (FaceGenGeometrySymmetric != null)
            {
                ele.TryPathTo("FaceGen/Geometry/Symmetric", true, out subEle);
                FaceGenGeometrySymmetric.WriteXML(subEle, master);
            }
            if (FaceGenGeometryAsymmetric != null)
            {
                ele.TryPathTo("FaceGen/Geometry/Asymmetric", true, out subEle);
                FaceGenGeometryAsymmetric.WriteXML(subEle, master);
            }
            if (FaceGenTexture != null)
            {
                ele.TryPathTo("FaceGen/Texture", true, out subEle);
                FaceGenTexture.WriteXML(subEle, master);
            }
            if (Unknown != null)
            {
                ele.TryPathTo("Unknown", true, out subEle);
                Unknown.WriteXML(subEle, master);
            }
            if (Height != null)
            {
                ele.TryPathTo("Height", true, out subEle);
                Height.WriteXML(subEle, master);
            }
            if (Weight != null)
            {
                ele.TryPathTo("Weight", true, out subEle);
                Weight.WriteXML(subEle, master);
            }
        }
示例#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("ObjectBounds", false, out subEle))
            {
                if (ObjectBounds == null)
                {
                    ObjectBounds = new ObjectBounds();
                }

                ObjectBounds.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Name", false, out subEle))
            {
                if (Name == null)
                {
                    Name = new SimpleSubrecord <String>();
                }

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

                Model.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("BaseStats", false, out subEle))
            {
                if (BaseStats == null)
                {
                    BaseStats = new NPCBaseStats();
                }

                BaseStats.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Factions", false, out subEle))
            {
                if (Factions == null)
                {
                    Factions = new List <FactionMembership>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    FactionMembership tempSNAM = new FactionMembership();
                    tempSNAM.ReadXML(e, master);
                    Factions.Add(tempSNAM);
                }
            }
            if (ele.TryPathTo("DeathItem", false, out subEle))
            {
                if (DeathItem == null)
                {
                    DeathItem = new RecordReference();
                }

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

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

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

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

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempSPLO = new RecordReference();
                    tempSPLO.ReadXML(e, master);
                    ActorEffects.Add(tempSPLO);
                }
            }
            if (ele.TryPathTo("Unarmed/AttackEffect", false, out subEle))
            {
                if (UnarmedAttackEffect == null)
                {
                    UnarmedAttackEffect = new RecordReference();
                }

                UnarmedAttackEffect.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unarmed/AttackAnimation", false, out subEle))
            {
                if (UnarmedAttackAnimation == null)
                {
                    UnarmedAttackAnimation = new SimpleSubrecord <UInt16>();
                }

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

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

                Script.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Contents", false, out subEle))
            {
                if (Contents == null)
                {
                    Contents = new List <InventoryItem>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    InventoryItem tempCNTO = new InventoryItem();
                    tempCNTO.ReadXML(e, master);
                    Contents.Add(tempCNTO);
                }
            }
            if (ele.TryPathTo("AIData", false, out subEle))
            {
                if (AIData == null)
                {
                    AIData = new AIData();
                }

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

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

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

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

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

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempPNAM = new RecordReference();
                    tempPNAM.ReadXML(e, master);
                    HeadParts.Add(tempPNAM);
                }
            }
            if (ele.TryPathTo("Hair/Type", false, out subEle))
            {
                if (HairType == null)
                {
                    HairType = new RecordReference();
                }

                HairType.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Hair/Length", false, out subEle))
            {
                if (HairLength == null)
                {
                    HairLength = new SimpleSubrecord <Single>();
                }

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

                Eyes.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Hair/Color", false, out subEle))
            {
                if (HairColor == null)
                {
                    HairColor = new SimpleSubrecord <Color>();
                }

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

                CombatStyle.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ImpactMaterialType", false, out subEle))
            {
                if (ImpactMaterialType == null)
                {
                    ImpactMaterialType = new SimpleSubrecord <MaterialTypeUInt>();
                }

                ImpactMaterialType.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("FaceGen/Geometry/Symmetric", false, out subEle))
            {
                if (FaceGenGeometrySymmetric == null)
                {
                    FaceGenGeometrySymmetric = new SimpleSubrecord <Byte[]>();
                }

                FaceGenGeometrySymmetric.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("FaceGen/Geometry/Asymmetric", false, out subEle))
            {
                if (FaceGenGeometryAsymmetric == null)
                {
                    FaceGenGeometryAsymmetric = new SimpleSubrecord <Byte[]>();
                }

                FaceGenGeometryAsymmetric.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("FaceGen/Texture", false, out subEle))
            {
                if (FaceGenTexture == null)
                {
                    FaceGenTexture = new SimpleSubrecord <Byte[]>();
                }

                FaceGenTexture.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Unknown", false, out subEle))
            {
                if (Unknown == null)
                {
                    Unknown = new SimpleSubrecord <UInt16>();
                }

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

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

                Weight.ReadXML(subEle, master);
            }
        }
示例#3
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 "FULL":
                    if (Name == null)
                    {
                        Name = new SimpleSubrecord <String>();
                    }

                    Name.ReadBinary(reader);
                    break;

                case "MODL":
                    if (Model == null)
                    {
                        Model = new Model();
                    }

                    Model.ReadBinary(reader);
                    break;

                case "ACBS":
                    if (BaseStats == null)
                    {
                        BaseStats = new NPCBaseStats();
                    }

                    BaseStats.ReadBinary(reader);
                    break;

                case "SNAM":
                    if (Factions == null)
                    {
                        Factions = new List <FactionMembership>();
                    }

                    FactionMembership tempSNAM = new FactionMembership();
                    tempSNAM.ReadBinary(reader);
                    Factions.Add(tempSNAM);
                    break;

                case "INAM":
                    if (DeathItem == null)
                    {
                        DeathItem = new RecordReference();
                    }

                    DeathItem.ReadBinary(reader);
                    break;

                case "VTCK":
                    if (VoiceType == null)
                    {
                        VoiceType = new RecordReference();
                    }

                    VoiceType.ReadBinary(reader);
                    break;

                case "TPLT":
                    if (Template == null)
                    {
                        Template = new RecordReference();
                    }

                    Template.ReadBinary(reader);
                    break;

                case "RNAM":
                    if (Race == null)
                    {
                        Race = new RecordReference();
                    }

                    Race.ReadBinary(reader);
                    break;

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

                    RecordReference tempSPLO = new RecordReference();
                    tempSPLO.ReadBinary(reader);
                    ActorEffects.Add(tempSPLO);
                    break;

                case "EITM":
                    if (UnarmedAttackEffect == null)
                    {
                        UnarmedAttackEffect = new RecordReference();
                    }

                    UnarmedAttackEffect.ReadBinary(reader);
                    break;

                case "EAMT":
                    if (UnarmedAttackAnimation == null)
                    {
                        UnarmedAttackAnimation = new SimpleSubrecord <UInt16>();
                    }

                    UnarmedAttackAnimation.ReadBinary(reader);
                    break;

                case "DEST":
                    if (Destructable == null)
                    {
                        Destructable = new Destructable();
                    }

                    Destructable.ReadBinary(reader);
                    break;

                case "SCRI":
                    if (Script == null)
                    {
                        Script = new RecordReference();
                    }

                    Script.ReadBinary(reader);
                    break;

                case "CNTO":
                    if (Contents == null)
                    {
                        Contents = new List <InventoryItem>();
                    }

                    InventoryItem tempCNTO = new InventoryItem();
                    tempCNTO.ReadBinary(reader);
                    Contents.Add(tempCNTO);
                    break;

                case "AIDT":
                    if (AIData == null)
                    {
                        AIData = new AIData();
                    }

                    AIData.ReadBinary(reader);
                    break;

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

                    RecordReference tempPKID = new RecordReference();
                    tempPKID.ReadBinary(reader);
                    Packages.Add(tempPKID);
                    break;

                case "CNAM":
                    if (Class == null)
                    {
                        Class = new RecordReference();
                    }

                    Class.ReadBinary(reader);
                    break;

                case "DATA":
                    if (Data == null)
                    {
                        Data = new NPCData();
                    }

                    Data.ReadBinary(reader);
                    break;

                case "DNAM":
                    if (Skills == null)
                    {
                        Skills = new NPCSkills();
                    }

                    Skills.ReadBinary(reader);
                    break;

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

                    RecordReference tempPNAM = new RecordReference();
                    tempPNAM.ReadBinary(reader);
                    HeadParts.Add(tempPNAM);
                    break;

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

                    HairType.ReadBinary(reader);
                    break;

                case "LNAM":
                    if (HairLength == null)
                    {
                        HairLength = new SimpleSubrecord <Single>();
                    }

                    HairLength.ReadBinary(reader);
                    break;

                case "ENAM":
                    if (Eyes == null)
                    {
                        Eyes = new RecordReference();
                    }

                    Eyes.ReadBinary(reader);
                    break;

                case "HCLR":
                    if (HairColor == null)
                    {
                        HairColor = new SimpleSubrecord <Color>();
                    }

                    HairColor.ReadBinary(reader);
                    break;

                case "ZNAM":
                    if (CombatStyle == null)
                    {
                        CombatStyle = new RecordReference();
                    }

                    CombatStyle.ReadBinary(reader);
                    break;

                case "NAM4":
                    if (ImpactMaterialType == null)
                    {
                        ImpactMaterialType = new SimpleSubrecord <MaterialTypeUInt>();
                    }

                    ImpactMaterialType.ReadBinary(reader);
                    break;

                case "FGGS":
                    if (FaceGenGeometrySymmetric == null)
                    {
                        FaceGenGeometrySymmetric = new SimpleSubrecord <Byte[]>();
                    }

                    FaceGenGeometrySymmetric.ReadBinary(reader);
                    break;

                case "FGGA":
                    if (FaceGenGeometryAsymmetric == null)
                    {
                        FaceGenGeometryAsymmetric = new SimpleSubrecord <Byte[]>();
                    }

                    FaceGenGeometryAsymmetric.ReadBinary(reader);
                    break;

                case "FGTS":
                    if (FaceGenTexture == null)
                    {
                        FaceGenTexture = new SimpleSubrecord <Byte[]>();
                    }

                    FaceGenTexture.ReadBinary(reader);
                    break;

                case "NAM5":
                    if (Unknown == null)
                    {
                        Unknown = new SimpleSubrecord <UInt16>();
                    }

                    Unknown.ReadBinary(reader);
                    break;

                case "NAM6":
                    if (Height == null)
                    {
                        Height = new SimpleSubrecord <Single>();
                    }

                    Height.ReadBinary(reader);
                    break;

                case "NAM7":
                    if (Weight == null)
                    {
                        Weight = new SimpleSubrecord <Single>();
                    }

                    Weight.ReadBinary(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
示例#4
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (ObjectBounds != null)
     {
         ObjectBounds.WriteBinary(writer);
     }
     if (Name != null)
     {
         Name.WriteBinary(writer);
     }
     if (Model != null)
     {
         Model.WriteBinary(writer);
     }
     if (BaseStats != null)
     {
         BaseStats.WriteBinary(writer);
     }
     if (Factions != null)
     {
         Factions.Sort();
         foreach (var item in Factions)
         {
             item.WriteBinary(writer);
         }
     }
     if (DeathItem != null)
     {
         DeathItem.WriteBinary(writer);
     }
     if (VoiceType != null)
     {
         VoiceType.WriteBinary(writer);
     }
     if (Template != null)
     {
         Template.WriteBinary(writer);
     }
     if (Race != null)
     {
         Race.WriteBinary(writer);
     }
     if (ActorEffects != null)
     {
         ActorEffects.Sort();
         foreach (var item in ActorEffects)
         {
             item.WriteBinary(writer);
         }
     }
     if (UnarmedAttackEffect != null)
     {
         UnarmedAttackEffect.WriteBinary(writer);
     }
     if (UnarmedAttackAnimation != null)
     {
         UnarmedAttackAnimation.WriteBinary(writer);
     }
     if (Destructable != null)
     {
         Destructable.WriteBinary(writer);
     }
     if (Script != null)
     {
         Script.WriteBinary(writer);
     }
     if (Contents != null)
     {
         Contents.Sort();
         foreach (var item in Contents)
         {
             item.WriteBinary(writer);
         }
     }
     if (AIData != null)
     {
         AIData.WriteBinary(writer);
     }
     if (Packages != null)
     {
         foreach (var item in Packages)
         {
             item.WriteBinary(writer);
         }
     }
     if (Class != null)
     {
         Class.WriteBinary(writer);
     }
     if (Data != null)
     {
         Data.WriteBinary(writer);
     }
     if (Skills != null)
     {
         Skills.WriteBinary(writer);
     }
     if (HeadParts != null)
     {
         HeadParts.Sort();
         foreach (var item in HeadParts)
         {
             item.WriteBinary(writer);
         }
     }
     if (HairType != null)
     {
         HairType.WriteBinary(writer);
     }
     if (HairLength != null)
     {
         HairLength.WriteBinary(writer);
     }
     if (Eyes != null)
     {
         Eyes.WriteBinary(writer);
     }
     if (HairColor != null)
     {
         HairColor.WriteBinary(writer);
     }
     if (CombatStyle != null)
     {
         CombatStyle.WriteBinary(writer);
     }
     if (ImpactMaterialType != null)
     {
         ImpactMaterialType.WriteBinary(writer);
     }
     if (FaceGenGeometrySymmetric != null)
     {
         FaceGenGeometrySymmetric.WriteBinary(writer);
     }
     if (FaceGenGeometryAsymmetric != null)
     {
         FaceGenGeometryAsymmetric.WriteBinary(writer);
     }
     if (FaceGenTexture != null)
     {
         FaceGenTexture.WriteBinary(writer);
     }
     if (Unknown != null)
     {
         Unknown.WriteBinary(writer);
     }
     if (Height != null)
     {
         Height.WriteBinary(writer);
     }
     if (Weight != null)
     {
         Weight.WriteBinary(writer);
     }
 }
示例#5
0
 public Eyes(Eyes copyObject)
 {
 }
示例#6
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("Description", false, out subEle))
            {
                if (Description == null)
                {
                    Description = new SimpleSubrecord <String>();
                }

                Description.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Relationships", false, out subEle))
            {
                if (Relationships == null)
                {
                    Relationships = new List <Relationship>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    Relationship tempXNAM = new Relationship();
                    tempXNAM.ReadXML(e, master);
                    Relationships.Add(tempXNAM);
                }
            }
            if (ele.TryPathTo("Data", false, out subEle))
            {
                if (Data == null)
                {
                    Data = new RaceData();
                }

                Data.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Race/Older", false, out subEle))
            {
                if (OlderRace == null)
                {
                    OlderRace = new RecordReference();
                }

                OlderRace.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Race/Younger", false, out subEle))
            {
                if (YoungerRace == null)
                {
                    YoungerRace = new RecordReference();
                }

                YoungerRace.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("UnknownMarker", false, out subEle))
            {
                if (UnknownMarker == null)
                {
                    UnknownMarker = new SubMarker();
                }

                UnknownMarker.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Defaults/Voices", false, out subEle))
            {
                if (DefaultVoices == null)
                {
                    DefaultVoices = new RaceDefaultVoices();
                }

                DefaultVoices.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Defaults/HairStyles", false, out subEle))
            {
                if (DefaultHairStyles == null)
                {
                    DefaultHairStyles = new RaceDefaultHairStyles();
                }

                DefaultHairStyles.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Defaults/HairColors", false, out subEle))
            {
                if (DefaultHairColors == null)
                {
                    DefaultHairColors = new RaceDefaultHairColors();
                }

                DefaultHairColors.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("FaceGen/Clamps/Main", false, out subEle))
            {
                if (FaceGenMainClamp == null)
                {
                    FaceGenMainClamp = new SimpleSubrecord <Single>();
                }

                FaceGenMainClamp.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("FaceGen/Clamps/Face", false, out subEle))
            {
                if (FaceGenFaceClamp == null)
                {
                    FaceGenFaceClamp = new SimpleSubrecord <Single>();
                }

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

                Unknown.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("HeadData", false, out subEle))
            {
                if (HeadData == null)
                {
                    HeadData = new RaceHeadData();
                }

                HeadData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("BodyData", false, out subEle))
            {
                if (BodyData == null)
                {
                    BodyData = new RaceBodyData();
                }

                BodyData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Hairs", false, out subEle))
            {
                if (Hairs == null)
                {
                    Hairs = new FormArray();
                }

                Hairs.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Eyes", false, out subEle))
            {
                if (Eyes == null)
                {
                    Eyes = new FormArray();
                }

                Eyes.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("FaceGen/Male", false, out subEle))
            {
                if (MaleFaceGenData == null)
                {
                    MaleFaceGenData = new FaceGenData();
                }

                MaleFaceGenData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("FaceGen/Female", false, out subEle))
            {
                if (FemaleFaceGenData == null)
                {
                    FemaleFaceGenData = new FaceGenData();
                }

                FemaleFaceGenData.ReadXML(subEle, master);
            }
        }
示例#7
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 (Description != null)
            {
                ele.TryPathTo("Description", true, out subEle);
                Description.WriteXML(subEle, master);
            }
            if (Relationships != null)
            {
                ele.TryPathTo("Relationships", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "Relationship"
                };
                int i = 0;
                foreach (var entry in Relationships)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (Data != null)
            {
                ele.TryPathTo("Data", true, out subEle);
                Data.WriteXML(subEle, master);
            }
            if (OlderRace != null)
            {
                ele.TryPathTo("Race/Older", true, out subEle);
                OlderRace.WriteXML(subEle, master);
            }
            if (YoungerRace != null)
            {
                ele.TryPathTo("Race/Younger", true, out subEle);
                YoungerRace.WriteXML(subEle, master);
            }
            if (UnknownMarker != null)
            {
                ele.TryPathTo("UnknownMarker", true, out subEle);
                UnknownMarker.WriteXML(subEle, master);
            }
            if (DefaultVoices != null)
            {
                ele.TryPathTo("Defaults/Voices", true, out subEle);
                DefaultVoices.WriteXML(subEle, master);
            }
            if (DefaultHairStyles != null)
            {
                ele.TryPathTo("Defaults/HairStyles", true, out subEle);
                DefaultHairStyles.WriteXML(subEle, master);
            }
            if (DefaultHairColors != null)
            {
                ele.TryPathTo("Defaults/HairColors", true, out subEle);
                DefaultHairColors.WriteXML(subEle, master);
            }
            if (FaceGenMainClamp != null)
            {
                ele.TryPathTo("FaceGen/Clamps/Main", true, out subEle);
                FaceGenMainClamp.WriteXML(subEle, master);
            }
            if (FaceGenFaceClamp != null)
            {
                ele.TryPathTo("FaceGen/Clamps/Face", true, out subEle);
                FaceGenFaceClamp.WriteXML(subEle, master);
            }
            if (Unknown != null)
            {
                ele.TryPathTo("Unknown", true, out subEle);
                Unknown.WriteXML(subEle, master);
            }
            if (HeadData != null)
            {
                ele.TryPathTo("HeadData", true, out subEle);
                HeadData.WriteXML(subEle, master);
            }
            if (BodyData != null)
            {
                ele.TryPathTo("BodyData", true, out subEle);
                BodyData.WriteXML(subEle, master);
            }
            if (Hairs != null)
            {
                ele.TryPathTo("Hairs", true, out subEle);
                Hairs.WriteXML(subEle, master);
            }
            if (Eyes != null)
            {
                ele.TryPathTo("Eyes", true, out subEle);
                Eyes.WriteXML(subEle, master);
            }
            if (MaleFaceGenData != null)
            {
                ele.TryPathTo("FaceGen/Male", true, out subEle);
                MaleFaceGenData.WriteXML(subEle, master);
            }
            if (FemaleFaceGenData != null)
            {
                ele.TryPathTo("FaceGen/Female", true, out subEle);
                FemaleFaceGenData.WriteXML(subEle, master);
            }
        }
示例#8
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (Name != null)
     {
         Name.WriteBinary(writer);
     }
     if (Description != null)
     {
         Description.WriteBinary(writer);
     }
     if (Relationships != null)
     {
         foreach (var item in Relationships)
         {
             item.WriteBinary(writer);
         }
     }
     if (Data != null)
     {
         Data.WriteBinary(writer);
     }
     if (OlderRace != null)
     {
         OlderRace.WriteBinary(writer);
     }
     if (YoungerRace != null)
     {
         YoungerRace.WriteBinary(writer);
     }
     if (UnknownMarker != null)
     {
         UnknownMarker.WriteBinary(writer);
     }
     if (DefaultVoices != null)
     {
         DefaultVoices.WriteBinary(writer);
     }
     if (DefaultHairStyles != null)
     {
         DefaultHairStyles.WriteBinary(writer);
     }
     if (DefaultHairColors != null)
     {
         DefaultHairColors.WriteBinary(writer);
     }
     if (FaceGenMainClamp != null)
     {
         FaceGenMainClamp.WriteBinary(writer);
     }
     if (FaceGenFaceClamp != null)
     {
         FaceGenFaceClamp.WriteBinary(writer);
     }
     if (Unknown != null)
     {
         Unknown.WriteBinary(writer);
     }
     if (HeadData != null)
     {
         HeadData.WriteBinary(writer);
     }
     if (BodyData != null)
     {
         BodyData.WriteBinary(writer);
     }
     if (Hairs != null)
     {
         Hairs.WriteBinary(writer);
     }
     if (Eyes != null)
     {
         Eyes.WriteBinary(writer);
     }
     if (MaleFaceGenData != null)
     {
         MaleFaceGenData.WriteBinary(writer);
     }
     if (FemaleFaceGenData != null)
     {
         FemaleFaceGenData.WriteBinary(writer);
     }
 }
示例#9
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 "DESC":
                    if (Description == null)
                    {
                        Description = new SimpleSubrecord <String>();
                    }

                    Description.ReadBinary(reader);
                    break;

                case "XNAM":
                    if (Relationships == null)
                    {
                        Relationships = new List <Relationship>();
                    }

                    Relationship tempXNAM = new Relationship();
                    tempXNAM.ReadBinary(reader);
                    Relationships.Add(tempXNAM);
                    break;

                case "DATA":
                    if (Data == null)
                    {
                        Data = new RaceData();
                    }

                    Data.ReadBinary(reader);
                    break;

                case "ONAM":
                    if (OlderRace == null)
                    {
                        OlderRace = new RecordReference();
                    }

                    OlderRace.ReadBinary(reader);
                    break;

                case "YNAM":
                    if (YoungerRace == null)
                    {
                        YoungerRace = new RecordReference();
                    }

                    YoungerRace.ReadBinary(reader);
                    break;

                case "NAM2":
                    if (UnknownMarker == null)
                    {
                        UnknownMarker = new SubMarker();
                    }

                    UnknownMarker.ReadBinary(reader);
                    break;

                case "VTCK":
                    if (DefaultVoices == null)
                    {
                        DefaultVoices = new RaceDefaultVoices();
                    }

                    DefaultVoices.ReadBinary(reader);
                    break;

                case "DNAM":
                    if (DefaultHairStyles == null)
                    {
                        DefaultHairStyles = new RaceDefaultHairStyles();
                    }

                    DefaultHairStyles.ReadBinary(reader);
                    break;

                case "CNAM":
                    if (DefaultHairColors == null)
                    {
                        DefaultHairColors = new RaceDefaultHairColors();
                    }

                    DefaultHairColors.ReadBinary(reader);
                    break;

                case "PNAM":
                    if (FaceGenMainClamp == null)
                    {
                        FaceGenMainClamp = new SimpleSubrecord <Single>();
                    }

                    FaceGenMainClamp.ReadBinary(reader);
                    break;

                case "UNAM":
                    if (FaceGenFaceClamp == null)
                    {
                        FaceGenFaceClamp = new SimpleSubrecord <Single>();
                    }

                    FaceGenFaceClamp.ReadBinary(reader);
                    break;

                case "ATTR":
                    if (Unknown == null)
                    {
                        Unknown = new SimpleSubrecord <Byte[]>();
                    }

                    Unknown.ReadBinary(reader);
                    break;

                case "NAM0":
                    if (HeadData == null)
                    {
                        HeadData = new RaceHeadData();
                    }

                    HeadData.ReadBinary(reader);
                    break;

                case "NAM1":
                    if (BodyData == null)
                    {
                        BodyData = new RaceBodyData();
                    }

                    BodyData.ReadBinary(reader);
                    break;

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

                    Hairs.ReadBinary(reader);
                    break;

                case "ENAM":
                    if (Eyes == null)
                    {
                        Eyes = new FormArray();
                    }

                    Eyes.ReadBinary(reader);
                    break;

                case "MNAM":
                    if (MaleFaceGenData == null)
                    {
                        MaleFaceGenData = new FaceGenData();
                    }

                    MaleFaceGenData.ReadBinary(reader);
                    break;

                case "FNAM":
                    if (FemaleFaceGenData == null)
                    {
                        FemaleFaceGenData = new FaceGenData();
                    }

                    FemaleFaceGenData.ReadBinary(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }