예제 #1
0
    def winning_alliance(self):
        from helpers.event_helper import EventHelper
        from helpers.match_helper import MatchHelper
        if self._winning_alliance is None:
            if EventHelper.is_2015_playoff(self.event_key_name) and self.comp_level != 'f':
                return ''  # report all 2015 non finals matches as ties

            red_score = int(self.alliances['red']['score'])
            blue_score = int(self.alliances['blue']['score'])
            if red_score > blue_score:
                self._winning_alliance = 'red'
            elif blue_score > red_score:
                self._winning_alliance = 'blue'
            else:  # tie
                self._winning_alliance = MatchHelper.tiebreak_winner(self)
        return self._winning_alliance
예제 #2
0
    def winning_alliance(self):
        from helpers.event_helper import EventHelper
        from helpers.match_helper import MatchHelper
        if self._winning_alliance is None:
            if EventHelper.is_2015_playoff(self.event_key_name) and self.comp_level != 'f':
                return ''  # report all 2015 non finals matches as ties

            red_score = int(self.alliances['red']['score'])
            blue_score = int(self.alliances['blue']['score'])
            if red_score > blue_score:
                self._winning_alliance = 'red'
            elif blue_score > red_score:
                self._winning_alliance = 'blue'
            else:  # tie
                event = self.event.get()
                if event and event.playoff_type == PlayoffType.ROUND_ROBIN_6_TEAM and event.event_type == EventType.CMP_FINALS:
                    self._winning_alliance == ''
                else:
                    self._winning_alliance = MatchHelper.tiebreak_winner(self)
        return self._winning_alliance
예제 #3
0
    def winning_alliance(self):
        from helpers.event_helper import EventHelper
        from helpers.match_helper import MatchHelper
        if self._winning_alliance is None:
            if EventHelper.is_2015_playoff(self.event_key_name) and self.comp_level != 'f':
                return ''  # report all 2015 non finals matches as ties

            red_score = int(self.alliances['red']['score'])
            blue_score = int(self.alliances['blue']['score'])
            if red_score > blue_score:
                self._winning_alliance = 'red'
            elif blue_score > red_score:
                self._winning_alliance = 'blue'
            else:  # tie
                event = self.event.get()
                if event and event.playoff_type == PlayoffType.ROUND_ROBIN_6_TEAM and event.event_type_enum == EventType.CMP_FINALS:
                    self._winning_alliance = ''
                else:
                    self._winning_alliance = MatchHelper.tiebreak_winner(self)
        return self._winning_alliance