Esempio n. 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("Data", false, out subEle))
            {
                if (Data == null)
                {
                    Data = new PackageData();
                }

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

                Location1.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Location2", false, out subEle))
            {
                if (Location2 == null)
                {
                    Location2 = new PackageLocation();
                }

                Location2.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Schedule", false, out subEle))
            {
                if (Schedule == null)
                {
                    Schedule = new PackageScheduleData();
                }

                Schedule.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Target1", false, out subEle))
            {
                if (Target1 == null)
                {
                    Target1 = new PackageTarget();
                }

                Target1.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Conditions", false, out subEle))
            {
                if (Conditions == null)
                {
                    Conditions = new List <Condition>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    Condition tempCTDA = new Condition();
                    tempCTDA.ReadXML(e, master);
                    Conditions.Add(tempCTDA);
                }
            }
            if (ele.TryPathTo("Idle/Flags", false, out subEle))
            {
                if (IdleFlags == null)
                {
                    IdleFlags = new SimpleSubrecord <PackageIdleFlags>();
                }

                IdleFlags.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Idle/Count", false, out subEle))
            {
                if (IdleCount == null)
                {
                    IdleCount = new SimpleSubrecord <Byte>();
                }

                IdleCount.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Idle/TimerSetting", false, out subEle))
            {
                if (IdleTimerSetting == null)
                {
                    IdleTimerSetting = new SimpleSubrecord <Single>();
                }

                IdleTimerSetting.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Idle/Animations", false, out subEle))
            {
                if (IdleAnimations == null)
                {
                    IdleAnimations = new FormArray();
                }

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

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

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

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

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

                FollowDistance_StartLocation_TriggerRadius.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("PatrolIsRepeatable", false, out subEle))
            {
                if (PatrolIsRepeatable == null)
                {
                    PatrolIsRepeatable = new SimpleSubrecord <NoYesByte>();
                }

                PatrolIsRepeatable.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("UseWeaponData", false, out subEle))
            {
                if (UseWeaponData == null)
                {
                    UseWeaponData = new PackageUseWeaponData();
                }

                UseWeaponData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Target2", false, out subEle))
            {
                if (Target2 == null)
                {
                    Target2 = new PackageTarget();
                }

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

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

                AmbushMarker.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("DialogData", false, out subEle))
            {
                if (DialogData == null)
                {
                    DialogData = new PackageDialogData();
                }

                DialogData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("DummyIgnore", false, out subEle))
            {
                if (DummyIgnore == null)
                {
                    DummyIgnore = new PackageLocation();
                }

                DummyIgnore.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("OnBegin", false, out subEle))
            {
                if (OnBegin == null)
                {
                    OnBegin = new PackageEvent();
                }

                OnBegin.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("OnEnd", false, out subEle))
            {
                if (OnEnd == null)
                {
                    OnEnd = new PackageEvent();
                }

                OnEnd.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("OnChange", false, out subEle))
            {
                if (OnChange == null)
                {
                    OnChange = new PackageEvent();
                }

                OnChange.ReadXML(subEle, master);
            }
        }