Esempio n. 1
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 "ENIT":
                    if (Data == null)
                    {
                        Data = new EnchantData();
                    }

                    Data.ReadBinary(reader);
                    break;

                case "EFID":
                    if (Effects == null)
                    {
                        Effects = new List <Effect>();
                    }

                    Effect tempEFID = new Effect();
                    tempEFID.ReadBinary(reader);
                    Effects.Add(tempEFID);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
Esempio n. 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("Name", false, out subEle))
            {
                if (Name == null)
                {
                    Name = new SimpleSubrecord <String>();
                }

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

                Data.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Effects", false, out subEle))
            {
                if (Effects == null)
                {
                    Effects = new List <Effect>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    Effect tempEFID = new Effect();
                    tempEFID.ReadXML(e, master);
                    Effects.Add(tempEFID);
                }
            }
        }
Esempio n. 3
0
 public ObjectEffect(SimpleSubrecord <String> EditorID, SimpleSubrecord <String> Name, EnchantData Data, List <Effect> Effects)
 {
     this.EditorID = EditorID;
     this.Data     = Data;
 }
Esempio n. 4
0
 public ObjectEffect()
 {
     EditorID = new SimpleSubrecord <String>("EDID");
     Data     = new EnchantData("ENIT");
 }