コード例 #1
0
ファイル: research.py プロジェクト: 19colt87/WOTDecompiled
    def __onGetItemsFromShop(self, itemTypeID, itemTypeIDs, resultID, data, _):
        if resultID < RES_SUCCESS:
            LOG_ERROR('Server return error shop %s items request: responseCode=' % ITEM_TYPE_NAMES[itemTypeID], resultID)
            data = {}
        parser = ShopDataParser(data)
        for intCD, price, _, _ in parser.getItemsIterator(self._data.getNationID(), itemTypeID):
            self._data.setShopPrice(intCD, price)

        self.__requestNextIShopItems(itemTypeIDs)
コード例 #2
0
    def getItems(self, itemTypeID = None, criteria = REQ_CRITERIA.EMPTY):
        from gui.shared.utils.requesters import ShopDataParser
        shopParser = ShopDataParser(self.shop.getItemsData())
        result = ItemsCollection()
        for intCD, _, _, _ in shopParser.getItemsIterator(itemTypeID=itemTypeID):
            item = self.getItemByCD(intCD)
            if criteria(item):
                result[intCD] = item

        return result
コード例 #3
0
    def getItems(self, itemTypeID=None, criteria=REQ_CRITERIA.EMPTY):
        from gui.shared.utils.requesters import ShopDataParser
        shopParser = ShopDataParser(self.shop.getItemsData())
        result = ItemsCollection()
        for intCD, _, _, _ in shopParser.getItemsIterator(
                itemTypeID=itemTypeID):
            item = self.getItemByCD(intCD)
            if criteria(item):
                result[intCD] = item

        return result
コード例 #4
0
    def __onGetItemsFromShop(self, itemTypeID, itemTypeIDs, resultID, data, _):
        if resultID < RES_SUCCESS:
            LOG_ERROR(
                'Server return error shop %s items request: responseCode=' %
                ITEM_TYPE_NAMES[itemTypeID], resultID)
            data = {}
        parser = ShopDataParser(data)
        for intCD, price, _, _ in parser.getItemsIterator(
                self._data.getNationID(), itemTypeID):
            self._data.setShopPrice(intCD, price)

        self.__requestNextIShopItems(itemTypeIDs)
コード例 #5
0
ファイル: techtree.py プロジェクト: 19colt87/WOTDecompiled
    def __onGetVehiclesFromShop(self, resultID, data, _):
        if resultID < RES_SUCCESS:
            LOG_ERROR('Server return error shop vehicles request: responseCode=' % resultID)
            data = {}
        parser = ShopDataParser(data)
        setShopPrice = self._data.setShopPrice
        addHidden = self._data.addHidden
        for intCD, price, isHidden, _ in parser.getItemsIterator(itemTypeID=_VEHICLE):
            setShopPrice(intCD, price)
            if isHidden:
                addHidden(intCD)

        self.__stopDataCollect()
コード例 #6
0
    def __onGetVehiclesFromShop(self, resultID, data, _):
        if resultID < RES_SUCCESS:
            LOG_ERROR(
                'Server return error shop vehicles request: responseCode=' %
                resultID)
            data = {}
        parser = ShopDataParser(data)
        setShopPrice = self._data.setShopPrice
        addHidden = self._data.addHidden
        for intCD, price, isHidden, _ in parser.getItemsIterator(
                itemTypeID=_VEHICLE):
            setShopPrice(intCD, price)
            if isHidden:
                addHidden(intCD)

        self.__stopDataCollect()