source/client/LiverpoolButtons.py
def newRound(hand_view, sets_runs_tuple):
    """ At start of each round (after all players hit OK) this creates buttons used to assign cards."""

    #  For liverpool need multiple buttons to assign cards to appropriate set/run.
    #  and need to do this at beginning of each round, so those buttons are in this separate method.
    # btns = a list  of lists. Index of outer list = player_index for each player, index of inner list = # of group.
    # Buttons are used as keys in Dictionary of visible cards. (e.g. for  k_group, card_group in visible_cards.items())
    # k_group is a tuple of (player index, group number) and corresponds to one of the buttons about to be created.
    # Groups that are sets are always before groups that are runs (code depends on that).
    #
    hand_view.buttons_per_player = sets_runs_tuple[0] + sets_runs_tuple[1]
    hand_view.assign_cards_btns = [[]]
    w = 75  # width of following buttons
    h = 20  # height of following buttons
    if hand_view.num_players > 1:
        players_sp_w = UIC.Disp_Width / hand_view.num_players
    else:
        players_sp_w = UIC.Disp_Width
    players_sp_h = UIC.Disp_Height / 8
    players_sp_top = (UIC.Disp_Height / 5) + players_sp_h
    for idx in range(hand_view.num_players - 1):
        hand_view.assign_cards_btns.append([])
    for idx in range(hand_view.num_players):
        for setnum in range(sets_runs_tuple[0]):
            # hand_view.assign_cards_btns[idx].append([])
            txt = "set " + str(setnum+1)
            x = 10 + (players_sp_w*idx)
            y = players_sp_top + (players_sp_h*setnum)
            prepare_card_btn = Btn.Button(UIC.White, x, y, w, h, text=txt)
            hand_view.assign_cards_btns[idx].append(prepare_card_btn)
        for runnum in range(sets_runs_tuple[1]):
            txt = "run " + str(runnum+1)
            jdx = sets_runs_tuple[0] + runnum
            x = 10 + (players_sp_w * idx)
            y = players_sp_top + (players_sp_h * jdx)
            prepare_card_btn = Btn.Button(UIC.White, x, y, w, h, text=txt)
            # hand_view.assign_cards_btns[idx][jdx] = prepare_card_btn
            hand_view.assign_cards_btns[idx].append(prepare_card_btn)
 At start of each round (after all players hit OK) this creates buttons used to assign cards.
At start of each round (after all players hit OK) this creates buttons used to assign cards.
At start of each round ( after all players hit OK ) this creates buttons used to assign cards .
def newRound(hand_view, sets_runs_tuple):
    hand_view.buttons_per_player = sets_runs_tuple[0] + sets_runs_tuple[1]
    hand_view.assign_cards_btns = [[]]
    w = 75   width of following buttons
    h = 20   height of following buttons
    if hand_view.num_players > 1:
        players_sp_w = UIC.Disp_Width / hand_view.num_players
    else:
        players_sp_w = UIC.Disp_Width
    players_sp_h = UIC.Disp_Height / 8
    players_sp_top = (UIC.Disp_Height / 5) + players_sp_h
    for idx in range(hand_view.num_players - 1):
        hand_view.assign_cards_btns.append([])
    for idx in range(hand_view.num_players):
        for setnum in range(sets_runs_tuple[0]):
             hand_view.assign_cards_btns[idx].append([])
            txt = "set " + str(setnum+1)
            x = 10 + (players_sp_w*idx)
            y = players_sp_top + (players_sp_h*setnum)
            prepare_card_btn = Btn.Button(UIC.White, x, y, w, h, text=txt)
            hand_view.assign_cards_btns[idx].append(prepare_card_btn)
        for runnum in range(sets_runs_tuple[1]):
            txt = "run " + str(runnum+1)
            jdx = sets_runs_tuple[0] + runnum
            x = 10 + (players_sp_w * idx)
            y = players_sp_top + (players_sp_h * jdx)
            prepare_card_btn = Btn.Button(UIC.White, x, y, w, h, text=txt)
             hand_view.assign_cards_btns[idx][jdx] = prepare_card_btn
            hand_view.assign_cards_btns[idx].append(prepare_card_btn)
def newRound ( hand_view , sets_runs_tuple ) : hand_view . buttons_per_player = sets_runs_tuple [ 0 ] + sets_runs_tuple [ 1 ] hand_view . assign_cards_btns = [ [ ] ] w = 75 h = 20 if hand_view . num_players > 1 : players_sp_w = UIC . Disp_Width / hand_view . num_players else : players_sp_w = UIC . Disp_Width players_sp_h = UIC . Disp_Height / 8 players_sp_top = ( UIC . Disp_Height / 5 ) + players_sp_h for idx in range ( hand_view . num_players - 1 ) : hand_view . assign_cards_btns . append ( [ ] ) for idx in range ( hand_view . num_players ) : for setnum in range ( sets_runs_tuple [ 0 ] ) : txt = "set " + str ( setnum + 1 ) x = 10 + ( players_sp_w * idx ) y = players_sp_top + ( players_sp_h * setnum ) prepare_card_btn = Btn . Button ( UIC . White , x , y , w , h , text = txt ) hand_view . assign_cards_btns [ idx ] . append ( prepare_card_btn ) for runnum in range ( sets_runs_tuple [ 1 ] ) : txt = "run " + str ( runnum + 1 ) jdx = sets_runs_tuple [ 0 ] + runnum x = 10 + ( players_sp_w * idx ) y = players_sp_top + ( players_sp_h * jdx ) prepare_card_btn = Btn . Button ( UIC . White , x , y , w , h , text = txt ) hand_view . assign_cards_btns [ idx ] . append ( prepare_card_btn )
At start of each round (after all players hit OK) this creates buttons used to assign cards.
At start of each round ( after all players hit OK ) this creates buttons used to assign cards .
""" At start of each round (after all players hit OK) this creates buttons used to assign cards.""" #  For liverpool need multiple buttons to assign cards to appropriate set/run. #  and need to do this at beginning of each round, so those buttons are in this separate method. # btns = a list  of lists. Index of outer list = player_index for each player, index of inner list = # of group. # Buttons are used as keys in Dictionary of visible cards. (e.g. for  k_group, card_group in visible_cards.items()) # k_group is a tuple of (player index, group number) and corresponds to one of the buttons about to be created. # Groups that are sets are always before groups that are runs (code depends on that). # # width of following buttons # height of following buttons # hand_view.assign_cards_btns[idx].append([]) # hand_view.assign_cards_btns[idx][jdx] = prepare_card_btn
hand_view
sets_runs_tuple