Пример #1
0
    def __packGroupByBlock(cls, groupByValue, groupByKey, battlesLeft, inrow, conds, isGroupCompleted):
        from gui.shared import g_itemsCache

        if isGroupCompleted:
            conds = []
        if groupByValue == "vehicle":
            vehicle = g_itemsCache.items.getItemByCD(groupByKey)
            return (
                vehicle,
                formatters.packGroupByVehicleConditions(
                    g_itemsCache.items.getItemByCD(groupByKey), battlesLeft, inrow, conds, isCompleted=isGroupCompleted
                ),
            )
        if groupByValue == "nation":
            return (
                GUI_NATIONS_ORDER_INDEX[groupByKey],
                formatters.packGroupByNationConditions(
                    groupByKey, battlesLeft, inrow, conds, isCompleted=isGroupCompleted
                ),
            )
        if groupByValue == "level":
            levelValue = int(groupByKey.replace("level ", ""))
            return (
                levelValue,
                formatters.packGroupByLevelConditions(
                    levelValue, battlesLeft, inrow, conds, isCompleted=isGroupCompleted
                ),
            )
        if groupByValue == "class":
            return (
                VEHICLE_TYPES_ORDER_INDICES[groupByKey],
                formatters.packGroupByClassConditions(
                    groupByKey, battlesLeft, inrow, conds, isCompleted=isGroupCompleted
                ),
            )
Пример #2
0
 def _packGroupByBlock(cls, groupByValue, groupByKey, battlesLeft, inrow, conds, isGroupCompleted):
     if isGroupCompleted:
         conds = []
     if groupByValue == 'vehicle':
         vehicle = cls.itemsCache.items.getItemByCD(groupByKey)
         return (vehicle, formatters.packGroupByVehicleConditions(cls.itemsCache.items.getItemByCD(groupByKey), battlesLeft, inrow, conds, isCompleted=isGroupCompleted))
     if groupByValue == 'nation':
         return (GUI_NATIONS_ORDER_INDEX[groupByKey], formatters.packGroupByNationConditions(groupByKey, battlesLeft, inrow, conds, isCompleted=isGroupCompleted))
     if groupByValue == 'level':
         levelValue = int(groupByKey.replace('level ', ''))
         return (levelValue, formatters.packGroupByLevelConditions(levelValue, battlesLeft, inrow, conds, isCompleted=isGroupCompleted))
     if groupByValue == 'class':
         return (VEHICLE_TYPES_ORDER_INDICES[groupByKey], formatters.packGroupByClassConditions(groupByKey, battlesLeft, inrow, conds, isCompleted=isGroupCompleted))