public void ReadLotteryXMLYB() { this.lotteryAwardItems.Clear(); List <SXML> sXMLList = XMLMgr.instance.GetSXMLList("lottery.item", null); for (int i = 0; i < sXMLList.Count; i++) { uint @uint = sXMLList[i].getUint("type"); List <SXML> nodeList = sXMLList[i].GetNodeList("item", ""); lotterydata lotterydata = new lotterydata(); lotterydata.type = @uint; bool flag = this.dataybs.ContainsKey(@uint); if (flag) { this.dataybs[@uint] = lotterydata; } else { this.dataybs.Add(@uint, lotterydata); } lotterydata.lotteryAwardItems = new List <itemLotteryAwardData>(); for (int j = 0; j < nodeList.Count; j++) { itemLotteryAwardData itemLotteryAwardData = new itemLotteryAwardData(); itemLotteryAwardData.rootType = @uint; itemLotteryAwardData.id = nodeList[j].getUint("id"); itemLotteryAwardData.itemType = nodeList[j].getUint("item_type"); itemLotteryAwardData.itemId = nodeList[j].getUint("item_id"); itemLotteryAwardData.num = nodeList[j].getUint("num"); itemLotteryAwardData.itemName = nodeList[j].getString("item_name"); itemLotteryAwardData.cost = nodeList[j].getUint("cost"); itemLotteryAwardData.stage = nodeList[j].getUint("stage"); itemLotteryAwardData.intensify = nodeList[j].getUint("intensify"); this.lotteryAwardItems.Add(itemLotteryAwardData); lotterydata.lotteryAwardItems.Add(itemLotteryAwardData); } } }
public void ReadLotteryXMLYB() { lotteryAwardItems.Clear(); List <SXML> xmls = XMLMgr.instance.GetSXMLList("lottery.item", null); for (int i = 0; i < xmls.Count; i++) { uint type = xmls[i].getUint("type"); List <SXML> xmlItems = xmls[i].GetNodeList("item"); lotterydata lotteryDataTemp = new lotterydata(); lotteryDataTemp.type = type; if (dataybs.ContainsKey(type)) { dataybs[type] = lotteryDataTemp; } else { dataybs.Add(type, lotteryDataTemp); } lotteryDataTemp.lotteryAwardItems = new List <itemLotteryAwardData>(); for (int j = 0; j < xmlItems.Count; j++) { itemLotteryAwardData lai = new itemLotteryAwardData(); lai.rootType = type; lai.id = xmlItems[j].getUint("id"); lai.itemType = xmlItems[j].getUint("item_type"); lai.itemId = xmlItems[j].getUint("item_id"); lai.num = xmlItems[j].getUint("num"); lai.itemName = xmlItems[j].getString("item_name"); lai.cost = xmlItems[j].getUint("cost"); lai.stage = xmlItems[j].getUint("stage"); lai.intensify = xmlItems[j].getUint("intensify"); lotteryAwardItems.Add(lai); lotteryDataTemp.lotteryAwardItems.Add(lai); } } }