def update(self, updatedSlotsData): for qTypeName in QUALIFIER_TYPE_NAMES.iterkeys(): self.__bonusData[qTypeName]["bonusAppliedCount"] = 0 self.__restoreInitialTooltipData() forEachSlotIn(updatedSlotsData, self.__initialSlotsData, self.__recalculateBonusData) self.__setAnimations() self.bonusesUpdated(self.__bonusData)
def update(self, updatedSlotsData): for qTypeName in QUALIFIER_TYPE_NAMES.iterkeys(): self.__bonusData[qTypeName]['bonusAppliedCount'] = 0 self.__restoreInitialTooltipData() forEachSlotIn(updatedSlotsData, self.__initialSlotsData, self.__recalculateBonusData) self.__setAnimations() self.bonusesUpdated(self.__bonusData)
def update(self, updatedSlotsData): self.__purchaseData = [] self.__totalPriceCredits = 0 self.__totalPriceGold = 0 forEachSlotIn(updatedSlotsData, self.__initialSlotsData, self.__recalculatePurchaseData) self.itemsUpdated(self.__purchaseData) self.totalPriceUpdated() if not bool(self.__totalPriceCredits + self.__totalPriceGold): if self.__isShown: self.emptied() self.__isShown = False elif not self.__isShown: self.filled() self.__isShown = True
def update(self, updatedSlotsData): self.__purchaseData = [] sortedContainer = [[], [], []] forEachSlotIn(updatedSlotsData, self.__initialSlotsData, functools.partial(self.__recalculatePurchaseData, sortedContainer)) self.__purchaseData = list(itertools.chain(*sortedContainer)) self.markDuplicates() self.recalculateTotalPrice() self.itemsUpdated(self.__purchaseData) self.totalPriceUpdated() if not bool(self.__totalPriceCredits + self.__totalPriceGold): if self.__isShown: self.emptied() self.__isShown = False elif not self.__isShown: self.filled() self.__isShown = True
def update(self, updatedSlotsData): self.__purchaseData = [] sortedContainer = [[], [], []] forEachSlotIn( updatedSlotsData, self.__initialSlotsData, functools.partial(self.__recalculatePurchaseData, sortedContainer)) self.__purchaseData = list(itertools.chain(*sortedContainer)) self.markDuplicates() self.recalculateTotalPrice() self.itemsUpdated(self.__purchaseData) self.totalPriceUpdated() if not bool(self.__totalPriceCredits + self.__totalPriceGold): if self.__isShown: self.emptied() self.__isShown = False elif not self.__isShown: self.filled() self.__isShown = True
def setInitialSlotsData(self, iSlotsData): if not self.__processingPurchase: self.__animationStarted = False self.__initialSlotsData = iSlotsData self.__bonusData = {} for qTypeName in QUALIFIER_TYPE_NAMES.iterkeys(): self.__bonusData[qTypeName] = {'bonusName': text_styles.main(_getBonusNameByType(qTypeName)), 'bonusIcon': _getBonusIcon42x42ByType(qTypeName), 'bonusTotalCount': 0, CUSTOMIZATION_TYPE.CAMOUFLAGE: [], CUSTOMIZATION_TYPE.EMBLEM: [], CUSTOMIZATION_TYPE.INSCRIPTION: [], 'oldBonusTotalCount': 0, 'bonusAppliedCount': 0, 'oldBonusAppliedCount': 0, 'bonusTotalDescriptionCount': 0, 'bonusAppliedDescriptionCount': 0} forEachSlotIn(iSlotsData, iSlotsData, self.__getInitialBonusData) self.__saveInitialTooltipData()
def setInitialSlotsData(self, iSlotsData): if not self.__processingPurchase: self.__animationStarted = False self.__initialSlotsData = iSlotsData self.__bonusData = {} for qTypeName in QUALIFIER_TYPE_NAMES.iterkeys(): self.__bonusData[qTypeName] = { 'bonusName': text_styles.main(_getBonusNameByType(qTypeName)), 'bonusIcon': _getBonusIcon42x42ByType(qTypeName), 'bonusTotalCount': 0, CUSTOMIZATION_TYPE.CAMOUFLAGE: [], CUSTOMIZATION_TYPE.EMBLEM: [], CUSTOMIZATION_TYPE.INSCRIPTION: [], 'oldBonusTotalCount': 0, 'bonusAppliedCount': 0, 'oldBonusAppliedCount': 0, 'bonusTotalDescriptionCount': 0, 'bonusAppliedDescriptionCount': 0 } forEachSlotIn(iSlotsData, iSlotsData, self.__getInitialBonusData) self.__saveInitialTooltipData()