/// <summary> /// 解析全局地图分配配置项 /// </summary> /// <param name="globalID"></param> /// <param name="otherNPCIDs"></param> /// <param name="goToMaps"></param> private static WuXingMapItem ParseGlobalConfigItem(int globalID, string otherNPCIDs, string goToMaps) { WuXingMapItem wuXingMapItem = null; if (WuXingMapDict.TryGetValue(globalID, out wuXingMapItem)) { return(wuXingMapItem); } wuXingMapItem = new WuXingMapItem() { GlobalID = globalID, OtherNPCIDList = Str2IntArray(otherNPCIDs), GoToMapCodeList = Str2IntArray(goToMaps), }; //判断是否异常 if (null == wuXingMapItem.OtherNPCIDList || null == wuXingMapItem.GoToMapCodeList || wuXingMapItem.OtherNPCIDList.Count != wuXingMapItem.GoToMapCodeList.Count) { throw new Exception(string.Format("解析五行奇阵配置文件时,解析NPC列表或者地图列表失败, GlobalID={0}", globalID)); } WuXingMapDict[globalID] = wuXingMapItem; return(wuXingMapItem); }
private static WuXingMapItem ParseGlobalConfigItem(int globalID, string otherNPCIDs, string goToMaps) { WuXingMapItem wuXingMapItem = null; WuXingMapItem result; if (WuXingMapMgr.WuXingMapDict.TryGetValue(globalID, out wuXingMapItem)) { result = wuXingMapItem; } else { wuXingMapItem = new WuXingMapItem { GlobalID = globalID, OtherNPCIDList = WuXingMapMgr.Str2IntArray(otherNPCIDs), GoToMapCodeList = WuXingMapMgr.Str2IntArray(goToMaps) }; if (wuXingMapItem.OtherNPCIDList == null || wuXingMapItem.GoToMapCodeList == null || wuXingMapItem.OtherNPCIDList.Count != wuXingMapItem.GoToMapCodeList.Count) { throw new Exception(string.Format("解析五行奇阵配置文件时,解析NPC列表或者地图列表失败, GlobalID={0}", globalID)); } WuXingMapMgr.WuXingMapDict[globalID] = wuXingMapItem; result = wuXingMapItem; } return(result); }
private static void ParseWuXingXmlItem(SystemXmlItem systemXmlItem) { int npcID = systemXmlItem.GetIntValue("NPCID", -1); int mapCode = systemXmlItem.GetIntValue("MapCode", -1); int needGoodsID = systemXmlItem.GetIntValue("NeedGoodsID", -1); int globalID = systemXmlItem.GetIntValue("GlobalID", -1); string otherNPCIDs = systemXmlItem.GetStringValue("OtherNPCIDs"); string goToMaps = systemXmlItem.GetStringValue("GoToMaps"); WuXingMapItem wuXingMapItem = WuXingMapMgr.ParseGlobalConfigItem(globalID, otherNPCIDs, goToMaps); WuXingNPCItem wuXingNPCItem = new WuXingNPCItem { NPCID = npcID, MapCode = mapCode, NeedGoodsID = needGoodsID, MapItem = wuXingMapItem }; string key = string.Format("{0}_{1}", mapCode, npcID); WuXingMapMgr.WuXingNPCDict[key] = wuXingNPCItem; }