示例#1
0
    def getAchievements(self, result):
        left = []
        right = []
        for intCD in self.__vehicles:
            if intCD not in result:
                continue
            data = result[intCD]
            achievements = shared.makeAchievementFromPersonal(data)
            for direction, achievement in achievements:
                if direction == 1:
                    right.append((achievement, True))
                left.append((achievement, True))

            achievement = shared.makeMarkOfMasteryFromPersonal(data)
            if achievement is not None:
                left.append((achievement, False))

        return (left, sorted(right, key=sort_keys.AchievementSortKey))
示例#2
0
    def getAchievements(self, result):
        """Gets sequence of personal achievements that was received in the battle.
        :param result: dict containing results['personal'].
        :return: tuple(achievements that are shown on the left side in the UI,
            achievements that are shown on the right side in the UI).
        """
        left = []
        right = []
        for intCD in self.__vehicles:
            if intCD not in result:
                continue
            data = result[intCD]
            achievements = shared.makeAchievementFromPersonal(data)
            for direction, achievement in achievements:
                if direction == 1:
                    right.append((achievement, True))
                else:
                    left.append((achievement, True))

            achievement = shared.makeMarkOfMasteryFromPersonal(data)
            if achievement is not None:
                left.append((achievement, False))

        return (left, sorted(right, key=sort_keys.AchievementSortKey))