示例#1
0
    def parseModules(data, itemTypeID, nationId):
        if data is None or not len(data):
            return []
        else:
            modules = []
            parser = ShopDataParser(data)
            for intCD, price, isHidden, sellForGold in parser.getItemsIterator(nationId, itemTypeID):
                modules.append(ShopItem(itemTypeName=ITEM_TYPE_NAMES[itemTypeID], compactDescr=intCD, priceOrder=price, nation=nationId, hidden=isHidden))

            return modules
示例#2
0
    def parseVehicles(data, nationId):
        if data is None or not len(data):
            return []
        else:
            result = []
            parser = ShopDataParser(data)
            for intCD, price, isHidden, sellForGold in parser.getItemsIterator(nationId, GUI_ITEM_TYPE.VEHICLE):
                _, _, innationID = vehicles.parseIntCompactDescr(intCD)
                result.append(ShopItem(itemTypeName=ITEM_TYPE_NAMES[GUI_ITEM_TYPE.VEHICLE], compactDescr=innationID, priceOrder=price, nation=nationId, hidden=isHidden))

            return result
示例#3
0
    def parseModules(data, itemTypeID, nationId):
        if data is None or not len(data):
            return []
        modules = []
        parser = ShopDataParser(data)
        for intCD, price, isHidden, sellForGold in parser.getItemsIterator(
                nationId, itemTypeID):
            modules.append(
                ShopItem(itemTypeName=ITEM_TYPE_NAMES[itemTypeID],
                         compactDescr=intCD,
                         priceOrder=price,
                         nation=nationId,
                         hidden=isHidden))

        return modules
示例#4
0
    def parseVehicles(data, nationId):
        if data is None or not len(data):
            return []
        result = []
        parser = ShopDataParser(data)
        for intCD, price, isHidden, sellForGold in parser.getItemsIterator(
                nationId, GUI_ITEM_TYPE.VEHICLE):
            _, _, innationID = vehicles.parseIntCompactDescr(intCD)
            result.append(
                ShopItem(itemTypeName=ITEM_TYPE_NAMES[GUI_ITEM_TYPE.VEHICLE],
                         compactDescr=innationID,
                         priceOrder=price,
                         nation=nationId,
                         hidden=isHidden))

        return result