def _getCurrentVehicleCopy(self): vehicle = Vehicle(strCompactDescr=self.__vehicle.descriptor.makeCompactDescr()) vehicle.crew = self.__vehicle.crew[:] for i, equipmentIntCD in enumerate(self.__vehicle.equipment.regularConsumables.getIntCDs(default=None)): vehicle_adjusters.installEquipment(vehicle, equipmentIntCD, i) vehicle.descriptor.activeGunShotIndex = self.__vehicle.descriptor.activeGunShotIndex return vehicle
def __makePreviewVehicleFromStrCD(self, vehicleStrCD): vehicle = Vehicle(strCompactDescr=vehicleStrCD, proxy=self.itemsCache.items) for slotID, device in enumerate(vehicle.optDevices): if device is not None: vehicle.descriptor.removeOptionalDevice(slotID) vehicle.optDevices[slotID] = None vehicle.crew = vehicle.getPerfectCrew() return vehicle
def __makePreviewVehicleFromStrCD(self, vehicleCD, vehicleStrCD): items = self.itemsCache.items vehicle = Vehicle(strCompactDescr=vehicleStrCD, proxy=items, extData=items.inventory.getVehExtData(vehicleCD)) for slotID, device in enumerate(vehicle.optDevices.installed): if device is not None: vehicle.descriptor.removeOptionalDevice(slotID) vehicle.optDevices.installed[slotID] = None vehicle.crew = vehicle.getPerfectCrew() return vehicle
def _getCurrentVehicleCopy(self): vehicle = Vehicle( strCompactDescr=self.__vehicle.descriptor.makeCompactDescr()) vehicle.crew = self.__vehicle.crew[:] for i, equipmentIntCD in enumerate( self.__vehicle.consumables.installed.getIntCDs(default=None)): vehicle_adjusters.installEquipment(vehicle, equipmentIntCD, i) vehicle.descriptor.activeGunShotIndex = self.__vehicle.descriptor.activeGunShotIndex cmp_helpers.applyCamouflage( vehicle, cmp_helpers.isCamouflageSet(self.__vehicle)) for battleBooster in self.__vehicle.battleBoosters.installed.getItems( ): vehicle_adjusters.installBattleBoosterOnVehicle( vehicle, battleBooster.intCD) return vehicle