Ejemplo n.º 1
0
 def getMaxAvailableItemsCount(self):
     """
     Returns tuple that contains max counts of booster that the user can buy for the current balance. Currency
     index in the tuple corresponds to the default order (see Currency.ALL).
     :return: CurrencyCollection(namedtuple)
     """
     buyPrice = self.__boosterBuyPricesSum.price
     return CurrencyCollection(*(self.__getMaxCount(buyPrice, currency)
                                 for currency in Currency.ALL))
Ejemplo n.º 2
0
 def getMaxAvailableItemsCount(self, module):
     """
     The maximum value is the value of items in inventory (no more then MAX_ITEMS_FOR_OPERATION)
     @param module: current item
     @return:
     """
     return CurrencyCollection(
         *(min(module.inventoryCount, MAX_ITEMS_FOR_OPERATION)
           for _ in Currency.ALL))
 def getMaxAvailableItemsCount(self, item):
     balance = self.itemsCache.items.stats.money
     return CurrencyCollection(*(self.__getMaxCount(item, currency, balance)
                                 for currency in Currency.ALL))
 def getMaxAvailableItemsCount(self, _):
     return CurrencyCollection(*(self.__count for _ in Currency.ALL))
Ejemplo n.º 5
0
 def getMaxAvailableItemsCount(self, module):
     return CurrencyCollection(
         *(min(module.inventoryCount, MAX_ITEMS_FOR_OPERATION)
           for _ in Currency.ALL))
Ejemplo n.º 6
0
 def getMaxAvailableItemsCount(self, module):
     return CurrencyCollection(*(1 for _ in Currency.ALL))
Ejemplo n.º 7
0
 def getMaxAvailableItemsCount(self, module):
     return CurrencyCollection(*(self.__getMaxCount(module, currency)
                                 for currency in Currency.ALL))
Ejemplo n.º 8
0
 def getMaxAvailableItemsCount(self):
     buyPrice = self.__boosterBuyPricesSum.price
     return CurrencyCollection(*(self.__getMaxCount(buyPrice, currency)
                                 for currency in Currency.ALL))