def checkTechEngineerActivity(type, dossier, nationID, unlocks = None): achieveName = 'mechanicEngineer' if nationID > -1: achieveName = '%s%d' % (achieveName, nationID) if unlocks is None: unlocks = getDossiersCache()['vehiclesInTrees'] res = getMechanicEngineerRequirements(set(), unlocks, nationID) if not len(res.get(achieveName, list())): return (True, None, 0) else: vList = __makeVehiclesList(res.get(type, [])) vList.sort(__vehiclesListSort) fullVehListLength = len(vList) if fullVehListLength >= ACHIEVEMENT_VEHICLES_MAX: vList = vList[:ACHIEVEMENT_VEHICLES_SHOW] return (False, vList, fullVehListLength)
def checkTechEngineerActivity(type, dossier, nationID, unlocks=None): achieveName = 'mechanicEngineer' if nationID > -1: achieveName = '%s%d' % (achieveName, nationID) if unlocks is None: unlocks = getDossiersCache()['vehiclesInTrees'] res = getMechanicEngineerRequirements(set(), unlocks, nationID) if not len(res.get(achieveName, list())): return (True, None, 0) else: vList = __makeVehiclesList(res.get(type, [])) vList.sort(__vehiclesListSort) fullVehListLength = len(vList) if fullVehListLength >= ACHIEVEMENT_VEHICLES_MAX: vList = vList[:ACHIEVEMENT_VEHICLES_SHOW] return (False, vList, fullVehListLength)
def _readLevelUpTotalValue(self, dossier): cache = getDossiersCache() if self._nationID != -1: return len(cache['vehiclesInTreesByNation'][self._nationID]) else: return len(cache['vehiclesInTrees'])
def __getMedalMousebanNextLevelValue(dossier): minFrags = RECORD_CONFIGS['mousebane'] mausFrags = dossier['vehTypeFrags'].get(getDossiersCache()['mausTypeCompDescr'], 0) medals, series = divmod(mausFrags, minFrags) return minFrags - medals
def _readProgressValue(self, dossier): return dossier.getRecord('vehTypeFrags').get(getDossiersCache()['mausTypeCompDescr'], 0)
def _readLevelUpTotalValue(self, dossier, proxy): cache = getDossiersCache() if self.nationID != -1: return len(cache['vehiclesInTreesByNation'][self.nationID]) else: return len(cache['vehiclesInTrees'])
def _readProgressValue(self, dossier): return dossier.getBlock('vehTypeFrags').get( getDossiersCache()['mausTypeCompDescr'], 0)
def _readProgressValue(self, dossier): return dossier.getBlock("vehTypeFrags").get(getDossiersCache()["mausTypeCompDescr"], 0)
def _getAllSuitableVehicles(cls): return getDossiersCache()['vehiclesInTrees']
def __getMedalMousebanNextLevelValue(dossier): minFrags = RECORD_CONFIGS['mousebane'] mausFrags = dossier['vehTypeFrags'].get( getDossiersCache()['mausTypeCompDescr'], 0) medals, series = divmod(mausFrags, minFrags) return minFrags - medals