Пример #1
0
    def setVehiclesInvIDs(self, vehicles):
        vehiclesIntCDs = []
        for invID in vehicles:
            vehicle = g_itemsCache.items.getVehicle(invID)
            if vehicle is None:
                vehiclesIntCDs.append(INV_ID_CLEAR_VEHICLE)
            else:
                vehiclesIntCDs.append(vehicle.intCD)

        self.__intCDs[self.getBattleType()] = vehiclesIntCDs
        AccountSettings.setFavorites(FALLOUT_VEHICLES, self.__intCDs)
        return
Пример #2
0
    def validateSelectedVehicles(self):
        maxVehs = self.getConfig().maxVehiclesPerPlayer
        valid = [INV_ID_CLEAR_VEHICLE] * maxVehs
        battleType = self.getBattleType()
        vehicles = self.__invIDs.get(battleType, ())
        vehGetter = g_itemsCache.items.getVehicle
        for idx, invID in enumerate(vehicles[:maxVehs]):
            invVehicle = vehGetter(invID)
            if invVehicle is not None:
                valid[idx] = invID

        if valid != vehicles:
            self.__invIDs[battleType] = valid
            AccountSettings.setFavorites(FALLOUT_VEHICLES, self.__invIDs)
            return True
        else:
            return False
Пример #3
0
    def validateSelectedVehicles(self):
        config = self.getConfig()
        battleType = self.getBattleType()
        vehicles = self.__intCDs.get(battleType, ())
        if not config.hasRequiredVehicles():
            valid = ()
        else:
            maxVehs = config.maxVehiclesPerPlayer
            valid = [INV_ID_CLEAR_VEHICLE] * maxVehs
            vehGetter = g_itemsCache.items.getItemByCD
            for idx, intCD in enumerate(vehicles[:maxVehs]):
                invVehicle = vehGetter(intCD)
                if invVehicle is not None and invVehicle.isInInventory:
                    valid[idx] = intCD

        if valid != vehicles:
            self.__intCDs[battleType] = valid
            AccountSettings.setFavorites(FALLOUT_VEHICLES, self.__intCDs)
        return
Пример #4
0
 def setVehiclesInvIDs(self, vehicles):
     self.__invIDs[self.getBattleType()] = vehicles
     AccountSettings.setFavorites(FALLOUT_VEHICLES, self.__invIDs)