app/gameimpl/x01_match.py
def check_winning_condition(self, player_index, visit):
        """returns 1, 2 or 3 for when a dart closes the game / leg (i.e. finishing double) or 0 if not closed out

        :param player_index: position of player details in various lists
        :param visit: a list of 3 Darts (each containing multiplier and segment)
        :return: 0, 1, 2 or 3
        """
        i = 0
        for dart in visit.darts:
            i = i + 1
            if dart.multiplier == DartMultiplier.DOUBLE and self.scores[player_index] - dart.get_score() == 0:
                # game, shot!
                self.scores[player_index] = 0
                self.match.status = MatchStatus.FINISHED
                return i
            else:
                print("deducting for " + str(player_index))
                self.scores[player_index] -= dart.get_score()

        return 0
returns 1, 2 or 3 for when a dart closes the game / leg (i.e. finishing double) or 0 if not closed out

        :param player_index: position of player details in various lists
        :param visit: a list of 3 Darts (each containing multiplier and segment)
        :return: 0, 1, 2 or 3
        
returns 1, 2 or 3 for when a dart closes the game / leg  or 0 if not closed out
returns 1 2 or 3 for when a dart closes the game / leg or 0 if not closed out
def check_winning_condition(self, player_index, visit):
        i = 0
        for dart in visit.darts:
            i = i + 1
            if dart.multiplier == DartMultiplier.DOUBLE and self.scores[player_index] - dart.get_score() == 0:
                self.scores[player_index] = 0
                self.match.status = MatchStatus.FINISHED
                return i
            else:
                print("deducting for " + str(player_index))
                self.scores[player_index] -= dart.get_score()
        return 0
def check_winning_condition ( self , player_index , visit ) : i = 0 for dart in visit . darts : i = i + 1 if dart . multiplier == DartMultiplier . DOUBLE and self . scores [ player_index ] - dart . get_score ( ) == 0 : self . scores [ player_index ] = 0 self . match . status = MatchStatus . FINISHED return i else : print ( "deducting for " + str ( player_index ) ) self . scores [ player_index ] -= dart . get_score ( ) return 0
returns 1, 2 or 3 for when a dart closes the game / leg (i.e.
returns 1 2 or 3 for when a dart closes the game / leg ( i . e .
"""returns 1, 2 or 3 for when a dart closes the game / leg (i.e. finishing double) or 0 if not closed out

        :param player_index: position of player details in various lists
        :param visit: a list of 3 Darts (each containing multiplier and segment)
        :return: 0, 1, 2 or 3
        """ # game, shot!
None
self
player_index
position of player details in various lists
position of player details in various lists
visit
a list of 3 Darts (each containing multiplier and segment)
a list of 3 Darts ( each containing multiplier and segment )