Exemplo n.º 1
0
 public DialogTopic()
 {
     EditorID = new SimpleSubrecord <String>("EDID");
     Name     = new SimpleSubrecord <String>("FULL");
     Priority = new SimpleSubrecord <float>("PNAM", 50);
     Data     = new DialogTopicData("DATA");
 }
Exemplo n.º 2
0
 public DialogTopic(SimpleSubrecord <String> EditorID, List <AddedQuest> AddedQuests, List <RecordReference> RemovedQuests, List <SharedInfo> UnusedInfos, SimpleSubrecord <String> Name, SimpleSubrecord <Single> Priority, SimpleSubrecord <String> Unknown, DialogTopicData Data)
 {
     this.EditorID = EditorID;
     this.Name     = Name;
     this.Priority = Priority;
     this.Data     = Data;
 }
Exemplo n.º 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 "QSTI":
                    if (AddedQuests == null)
                    {
                        AddedQuests = new List <AddedQuest>();
                    }

                    AddedQuest tempQSTI = new AddedQuest();
                    tempQSTI.ReadBinary(reader);
                    AddedQuests.Add(tempQSTI);
                    break;

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

                    RecordReference tempQSTR = new RecordReference();
                    tempQSTR.ReadBinary(reader);
                    RemovedQuests.Add(tempQSTR);
                    break;

                case "INFC":
                    if (UnusedInfos == null)
                    {
                        UnusedInfos = new List <SharedInfo>();
                    }

                    SharedInfo tempINFC = new SharedInfo();
                    tempINFC.ReadBinary(reader);
                    UnusedInfos.Add(tempINFC);
                    break;

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

                    Name.ReadBinary(reader);
                    break;

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

                    Priority.ReadBinary(reader);
                    break;

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

                    Unknown.ReadBinary(reader);
                    break;

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

                    Data.ReadBinary(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
Exemplo n.º 4
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("AddedQuests", false, out subEle))
            {
                if (AddedQuests == null)
                {
                    AddedQuests = new List <AddedQuest>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    AddedQuest tempQSTI = new AddedQuest();
                    tempQSTI.ReadXML(e, master);
                    AddedQuests.Add(tempQSTI);
                }
            }
            if (ele.TryPathTo("RemovedQuests", false, out subEle))
            {
                if (RemovedQuests == null)
                {
                    RemovedQuests = new List <RecordReference>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    RecordReference tempQSTR = new RecordReference();
                    tempQSTR.ReadXML(e, master);
                    RemovedQuests.Add(tempQSTR);
                }
            }
            if (ele.TryPathTo("UnusedInfos", false, out subEle))
            {
                if (UnusedInfos == null)
                {
                    UnusedInfos = new List <SharedInfo>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    SharedInfo tempINFC = new SharedInfo();
                    tempINFC.ReadXML(e, master);
                    UnusedInfos.Add(tempINFC);
                }
            }
            if (ele.TryPathTo("Name", false, out subEle))
            {
                if (Name == null)
                {
                    Name = new SimpleSubrecord <String>();
                }

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

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

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

                Data.ReadXML(subEle, master);
            }
        }