コード例 #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 "NVER":
                    if (Version == null)
                    {
                        Version = new SimpleSubrecord <UInt32>();
                    }

                    Version.ReadBinary(reader);
                    break;

                case "NVMI":
                    if (NavigationMapInfoList == null)
                    {
                        NavigationMapInfoList = new List <NavigationMapInfo>();
                    }

                    NavigationMapInfo tempNVMI = new NavigationMapInfo();
                    tempNVMI.ReadBinary(reader);
                    NavigationMapInfoList.Add(tempNVMI);
                    break;

                case "NVCI":
                    if (NavigationConnectionInfoList == null)
                    {
                        NavigationConnectionInfoList = new List <NavigationConnectionInfo>();
                    }

                    NavigationConnectionInfo tempNVCI = new NavigationConnectionInfo();
                    tempNVCI.ReadBinary(reader);
                    NavigationConnectionInfoList.Add(tempNVCI);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
コード例 #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("Version", false, out subEle))
            {
                if (Version == null)
                {
                    Version = new SimpleSubrecord <UInt32>();
                }

                Version.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("NavigationMapInfoList", false, out subEle))
            {
                if (NavigationMapInfoList == null)
                {
                    NavigationMapInfoList = new List <NavigationMapInfo>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    NavigationMapInfo tempNVMI = new NavigationMapInfo();
                    tempNVMI.ReadXML(e, master);
                    NavigationMapInfoList.Add(tempNVMI);
                }
            }
            if (ele.TryPathTo("NavigationConnectionInfoList", false, out subEle))
            {
                if (NavigationConnectionInfoList == null)
                {
                    NavigationConnectionInfoList = new List <NavigationConnectionInfo>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    NavigationConnectionInfo tempNVCI = new NavigationConnectionInfo();
                    tempNVCI.ReadXML(e, master);
                    NavigationConnectionInfoList.Add(tempNVCI);
                }
            }
        }