Exemplo n.º 1
0
 public void Purchase(BaseItemShopSlot baseItemShopSlot)
 {
     if (_inventoryContainer.CanStore())
     {
         if (_characterStatusController.CurrentMoney >= baseItemShopSlot.ITEMSHOP.ItemPrice)
         {
             int index = baseItemShopSlot.ITEMSHOP.ItemSetIdIndex;
             _storeContoller.StoreDic[_storeId].Purchase(index);
             bool isEmpty = baseItemShopSlot.Purchase();
             if (!isEmpty)
             {
                 OnPurchaseOutStock?.Invoke();
             }
             _characterStatusController.TakeMoney(baseItemShopSlot.ITEMSHOP.ItemPrice);
             GetItem(baseItemShopSlot);
             _totalItem--;
             CheckInvIsEmpty();
         }
         else
         {
             _notificationController.MoneyNotEnough(baseItemShopSlot);
         }
     }
     else
     {
         _notificationController.InventoryFull();
     }
 }