def unpack(self, component, proxy): """ Carve up items applicable for the container from the outfit component. :param component: an instance of CustomizationOutfit. :param proxy: an instance of ItemRequester. """ for slot in self.slots(): packer = packers.pickPacker(slot.getType()) packer.unpack(slot, component, proxy)
def pack(self, component): """ Fill the given component with the subcomponents. Subcomponents will be created from items stored inside container. :param component: an instance of CustomizationOutfit. """ for slot in self.slots(): packer = packers.pickPacker(slot.getType()) packer.pack(slot, component)
def _packIconBlock(self, isHistorical=False): linkAs = BLOCKS_TOOLTIP_TYPES.TOOLTIP_IMAGE_BLOCK_LINKAGE width = self._countImageWidth() if self._specialArgs: component = pickPacker( self._item.itemTypeID).getRawComponent()(*self._specialArgs) else: component = None if isHistorical is not True: linkAs = BLOCKS_TOOLTIP_TYPES.TOOLTIP_IMAGE_BLOCK_NON_HISTORICAL_LINKAGE return formatters.packImageBlockData( img=self._item.getIconApplied(component), linkage=linkAs, align=BLOCKS_TOOLTIP_TYPES.ALIGN_CENTER, width=width, height=self.CUSTOMIZATION_TOOLTIP_ICON_HEIGHT, padding=formatters.packPadding(bottom=2))
def invalidate(self): for slot in self.slots(): packer = packers.pickPacker(slot.getType()) packer.invalidate(slot)
def unpack(self, component, proxy): for slot in self.slots(): packer = packers.pickPacker(slot.getType()) packer.unpack(slot, component, proxy)
def pack(self, component): for slot in self.slots(): packer = packers.pickPacker(slot.getType()) packer.pack(slot, component)
def invalidate(self): """ Use packers to populate components with proper data. """ for slot in self.slots(): packer = packers.pickPacker(slot.getType()) packer.invalidate(slot)