Exemplo n.º 1
0
 /// <summary>
 /// 将物品掉落按宝箱分组
 /// </summary>
 /// <param name="itemBoxs"></param>
 /// <returns></returns>
 public static Dictionary<int, List<ItemBoxInfo>> LoadItemBoxs(ItemBoxInfo[] itemBoxs)
 {
     Dictionary<int, List<ItemBoxInfo>> infos = new Dictionary<int, List<ItemBoxInfo>>();
     foreach (ItemBoxInfo info in itemBoxs)
     {
         if (!infos.Keys.Contains(info.DataId))
         { 
             IEnumerable<ItemBoxInfo> temp=itemBoxs.Where(s=>s.DataId==info.DataId);
             infos.Add(info.DataId, temp.ToList());
         }
     }
     return infos;
 }
Exemplo n.º 2
0
 public static XElement CreateItemBoxInfo(ItemBoxInfo info)
 {
     return new XElement("Item", new XAttribute("ID", info.Id),
         new XAttribute("TemplateId", info.TemplateId),
         new XAttribute("StrengthenLevel", info.StrengthenLevel),
         new XAttribute("IsBind", info.IsBind),
         new XAttribute("ItemCount", info.ItemCount),
         new XAttribute("LuckCompose", info.LuckCompose),
         new XAttribute("DefendCompose", info.DefendCompose),
         new XAttribute("AttackCompose", info.AttackCompose),
         new XAttribute("AgilityCompose", info.AgilityCompose),
         new XAttribute("ItemValid", info.ItemValid),
         new XAttribute("IsTips", info.IsTips));
 }
Exemplo n.º 3
0
 public ItemBoxInfo InitItemBoxInfo(SqlDataReader reader)
 {
     ItemBoxInfo info = new ItemBoxInfo();
     info.Id = (int)reader["id"];
     info.DataId = (int)reader["DataId"];
     info.TemplateId = (int)reader["TemplateId"];
     info.IsSelect = (bool)reader["IsSelect"];
     info.IsBind = (bool)reader["IsBind"];
     info.ItemValid = (int)reader["ItemValid"];
     info.ItemCount = (int)reader["ItemCount"];
     info.StrengthenLevel = (int)reader["StrengthenLevel"];
     info.AttackCompose = (int)reader["AttackCompose"];
     info.DefendCompose = (int)reader["DefendCompose"];
     info.AgilityCompose = (int)reader["AgilityCompose"];
     info.LuckCompose = (int)reader["LuckCompose"];
     info.Random = (int)reader["Random"];
     info.IsTips = (int)reader["IsTips"];
     info.IsLogs = (bool)reader["IsLogs"];
     return info;
 }