Beispiel #1
0
        //----------------------------------------------------------------------------
        private void LoadXml(string strFileName)
        {
            string      XmlData = FileSystem.Instance().LoadGameData(strFileName);
            XmlDocument xmlDoc  = new XmlDocument();

            xmlDoc.LoadXml(XmlData);
            XmlNode rootNode = xmlDoc.SelectSingleNode("PromptData");

            if (rootNode == null)
            {
                return;
            }
            XmlElement indexElm = rootNode.FirstChild as XmlElement;

            if (indexElm == null)
            {
                return;
            }
            XmlElement elm = indexElm.FirstChild as XmlElement;

            while (elm != null)
            {
                stPromptData data = new stPromptData();
                string       id   = elm.GetAttribute("ID");
                string       desc = elm.GetAttribute("Desc");
                data.strDesc = desc;
                m_DescDict.Add(id, data);
                elm = elm.NextSibling as XmlElement;
            }
        }
Beispiel #2
0
        //----------------------------------------------------------------------------
        public override void Deserialize()
        {
            BinaryReader bw = m_layerData.GetStreamReader();

            if (bw == null)
            {
                return;
            }
            int count = bw.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                string       key = GameUtil.ReadString(bw);
                stPromptData obj = new stPromptData();
                obj.Deserialize(bw);
                m_DescDict.Add(key, obj);
            }
        }