def __extractBonuses(self, data): outcome = [] for k, value in data.iteritems(): bonusObj = [] if k == 'completedQuestIDs': continue elif k == 'vehicles': for vehiclesDict in value: bonusObj.extend(getTutorialBonuses(k, vehiclesDict)) else: bonusObj = getTutorialBonuses(k, value) outcome.extend(bonusObj) return outcome
def getBonusForBootcampMission(self): finalBonuses = [] for bonusType, bonusValue in self.lobbyContext.getServerSettings( ).getBootcampBonuses().iteritems(): finalBonuses.extend(getTutorialBonuses(bonusType, bonusValue)) return finalBonuses
def _getBonuses(self): bonuses = self.__content.get('bonuses', {}) result = [] for n, v in bonuses.iteritems(): result.extend(getTutorialBonuses(n, v)) return result
def _getBonuses(self): if self._quest is not None: allBonuses = getMissionInfoData(self._quest).getSubstituteBonuses() bonuses = [ bonus for bonus in allBonuses if bonus.getName() != 'vehicles' ] vehBonus = getTutorialBonuses('vehicles', self._vehicles) bonuses.extend(vehBonus) return bonuses else: return []