コード例 #1
0
        private static void ParseXmlItem(SystemXmlItem systemXmlItem)
        {
            int mapCode                    = systemXmlItem.GetIntValue("MapCode", -1);
            int fuBenID                    = systemXmlItem.GetIntValue("CopyID", -1);
            int maxTime                    = systemXmlItem.GetIntValue("MaxTime", -1);
            int money                      = systemXmlItem.GetIntValue("Moneyaward", -1);
            int experience                 = systemXmlItem.GetIntValue("Experienceaward", -1);
            int nTmpFirstGold              = systemXmlItem.GetIntValue("FirstGold", -1);
            int nTmpFirstExp               = systemXmlItem.GetIntValue("FirstExp", -1);
            int nMinSaoDangTimer           = systemXmlItem.GetIntValue("MinSaoDangTime", -1);
            int nTmpXingHunAward           = systemXmlItem.GetIntValue("XingHunaward", -1);
            int nTmpFirstXingHunAward      = systemXmlItem.GetIntValue("FirstXingHun", -1);
            int nTmpZhanGongaward          = systemXmlItem.GetIntValue("ZhanGongaward", -1);
            int YuanSuFenMoaward           = systemXmlItem.GetIntValue("YuanSuFenMoaward", -1);
            int lightAward                 = systemXmlItem.GetIntValue("YingGuangaward", -1);
            List <GoodsData> goodsDataList = null;
            string           goodsIDs      = systemXmlItem.GetStringValue("GoodsIDs");

            if (!string.IsNullOrEmpty(goodsIDs))
            {
                string[] fields = goodsIDs.Split(new char[]
                {
                    '|'
                });
                if (fields.Length > 0)
                {
                    goodsDataList = FuBenManager.ParseGoodsDataList(fields);
                }
            }
            List <GoodsData> goodsFirstDataList = null;
            string           goodsFirstIDs      = systemXmlItem.GetStringValue("FirstGoodsID");

            if (!string.IsNullOrEmpty(goodsFirstIDs))
            {
                string[] fields = goodsFirstIDs.Split(new char[]
                {
                    '|'
                });
                if (fields.Length > 0)
                {
                    goodsFirstDataList = FuBenManager.ParseGoodsDataList(fields);
                }
            }
            FuBenMapItem fuBenMapItem = new FuBenMapItem
            {
                FuBenID            = fuBenID,
                MapCode            = mapCode,
                MaxTime            = maxTime,
                Money1             = money,
                Experience         = experience,
                GoodsDataList      = goodsDataList,
                FirstGoodsDataList = goodsFirstDataList,
                MinSaoDangTimer    = nMinSaoDangTimer,
                nFirstExp          = nTmpFirstExp,
                nFirstGold         = nTmpFirstGold,
                nXingHunAward      = nTmpXingHunAward,
                nFirstXingHunAward = nTmpFirstXingHunAward,
                nZhanGongaward     = nTmpZhanGongaward,
                YuanSuFenMoaward   = YuanSuFenMoaward,
                LightAward         = lightAward
            };
            string key = string.Format("{0}_{1}", fuBenID, mapCode);

            lock (FuBenManager._FuBenMapCode2MapItemDict)
            {
                FuBenManager._FuBenMapCode2MapItemDict[key] = fuBenMapItem;
            }
            List <int> mapCodeList = null;

            if (!FuBenManager._FuBen2MapCodeListDict.TryGetValue(fuBenID, out mapCodeList))
            {
                mapCodeList = new List <int>();
                FuBenManager._FuBen2MapCodeListDict[fuBenID] = mapCodeList;
            }
            mapCodeList.Add(mapCode);
            FuBenManager._MapCode2FuBenDict[mapCode] = fuBenID;
        }