Exemple #1
0
    def setLocatables(self, items):
        if not self.areLocatablesReady:
            return
        self._locatableItems = InvItemList(map(lambda x: (x.getLocation(), x), receiveSwitchField(items, InvItem)))
        for currLoc in self._locatableItems:
            messenger.send(getLocationChangeMsg(self.doId), [currLoc])
            item = self._locatableItems[currLoc]
            messenger.send(getCategoryChangeMsg(self.doId, item.getCat()), [item.getType()])
            messenger.send(getCategoryQuantChangeMsg(self.doId, item.getCat()), [item.getCount()])

        messenger.send(getAnyChangeMsg(self.doId))
    def setLocatables(self, items):
        if not self.areLocatablesReady:
            return None

        self._locatableItems = InvItemList(map(lambda x: (x.getLocation(), x), receiveSwitchField(items, InvItem)))
        for currLoc in self._locatableItems:
            messenger.send(getLocationChangeMsg(self.doId), [
                currLoc])
            item = self._locatableItems[currLoc]
            messenger.send(getCategoryChangeMsg(self.doId, item.getCat()), [
                item.getType()])
            messenger.send(getCategoryQuantChangeMsg(self.doId, item.getCat()), [
                item.getCount()])

        messenger.send(getAnyChangeMsg(self.doId))