def __precacheEquipments(self, vehiclesCache): self.__cache.setdefault(nations.NONE_INDEX, {})[ITEM_TYPES.equipment] = {} for eqpDescr in vehicles.g_cache.equipments().itervalues(): equipmentNations = set() for vDescr in vehiclesCache.generator(): if not eqpDescr.checkCompatibilityWithVehicle(vDescr)[0]: continue nation, _ = vDescr.type.id equipmentNations.add(nation) self.__cache[nations.NONE_INDEX][ITEM_TYPES.equipment][ eqpDescr.compactDescr] = PrecachedEquipment( nations=equipmentNations, params=getEquipmentParameters(eqpDescr))
def __precacheEquipments(self): self.__cache.setdefault(nations.NONE_INDEX, {})[ITEM_TYPES.equipment] = {} equipments = self.__getItems(ITEM_TYPES.equipment, nations.NONE_INDEX) for eqpDescr in equipments: equipmentNations = set() for vDescr in self.__getItems(ITEM_TYPES.vehicle): if not eqpDescr.checkCompatibilityWithVehicle(vDescr)[0]: continue nation, id = vDescr.type.id equipmentNations.add(nation) self.__cache[nations.NONE_INDEX][ITEM_TYPES.equipment][ eqpDescr.compactDescr] = PrecachedEquipment( nations=equipmentNations, avgParams=getEquipmentParameters(eqpDescr))
def __precachEquipments(self): self.__cache.setdefault(nations.NONE_INDEX, {})[ITEM_TYPES.equipment] = {} equipments = self.__getItems(ITEM_TYPES.equipment, nations.NONE_INDEX) for eqpDescr in equipments: equipmentNations = set() for vDescr in self.__getItems(ITEM_TYPES.vehicle): if not eqpDescr.checkCompatibilityWithVehicle(vDescr)[0]: continue nation, id = vDescr.type.id equipmentNations.add(nation) self.__cache[nations.NONE_INDEX][ITEM_TYPES.equipment][eqpDescr.compactDescr] = PrecachedEquipment(nations=equipmentNations, avgParams=getEquipmentParameters(eqpDescr))