Exemple #1
0
 public void UpdateBagItem(CItem Item)
 {
     if (!_updateItem(Item))
     {
         CBagItem newitem = new CBagItem();
         newitem.ItemData = Item;
         AddBagItem(newitem);
     }
 }
Exemple #2
0
 public bool getBagIndex(CItem a_item, out UInt32 a_index)
 {
     for (int i = 0; i < m_itemList.Count; ++i)
     {
         if (m_itemList[i].ItemData.ItemIndex == a_item.ItemIndex)
         {
             a_index = (UInt32)i;
             return(true);
         }
     }
     a_index = 0;
     return(false);
 }
Exemple #3
0
 private bool _updateItem(CItem a_item)
 {
     if (a_item.ItemCount == 0)
     {
         _deleteItem(a_item.ItemIndex);
         return(true);
     }
     for (int i = 0; i < m_itemList.Count; ++i)
     {
         if (m_itemList[i].ItemData.ItemIndex == a_item.ItemIndex)
         {
             m_itemList[i].ItemData = a_item;
             return(true);
         }
     }
     return(false);
 }
Exemple #4
0
 /// <summary>
 /// 设置背包数据
 /// </summary>
 /// <param name="ItemData"></param>
 public void setPackageItemData(CItem ItemData)
 {
     m_ItemData = ItemData;
 }