コード例 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="item"></param>
 /// <param name="quantity"></param>
 /// <param name="slot"></param>
 /// <returns></returns>
 public ItemDAO MoveQuantity(ItemDAO item, int quantity, ItemSlotEnum slot = ItemSlotEnum.SLOT_INVENTORY)
 {
     if (quantity >= item.Quantity)
     {
         return(RemoveItem(item.Id, item.Quantity));
     }
     item.Quantity -= quantity;
     OnItemQuantity(item.Id, item.Quantity);
     return(item.Clone(quantity));
 }
コード例 #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="item"></param>
 /// <param name="quantity"></param>
 /// <param name="slot"></param>
 /// <returns></returns>
 public ItemDAO MoveQuantity(ItemDAO item, int quantity, ItemSlotEnum slot = ItemSlotEnum.SLOT_INVENTORY)
 {
     if(quantity >= item.Quantity)
         return RemoveItem(item.Id, item.Quantity);
     item.Quantity -= quantity;
     OnItemQuantity(item.Id, item.Quantity);
     return item.Clone(quantity);
 }