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
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
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
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