Beispiel #1
0
def draw_cards(statics, input_, screen):
    try:
        screen.drawn_cards = screen.deck.draw(int(input_))
        for card in screen.drawn_cards:
            store.put_card(statics.BOARD_DB_NAME, card.to_json_dict())
    except:
        pass
Beispiel #2
0
def put_back_card(statics, input_, screen):
    try:
        id = int(input_)
        card = screen.drawn_cards[id - 1]
        screen.drawn_cards = screen.drawn_cards[:id -
                                                1] + screen.drawn_cards[id:]
        screen.deck.put(card)
        store.delete_cards(statics.BOARD_DB_NAME)
        for card in screen.drawn_cards:
            store.put_card(statics.BOARD_DB_NAME, card.to_json_dict())
    except:
        pass
Beispiel #3
0
def shuffle_in_card(statics, input_, screen):
    try:
        id = int(input_)
        if id <= len(screen.drawn_cards):
            card = screen.drawn_cards[id - 1]
            screen.drawn_cards = screen.drawn_cards[:id -
                                                    1] + screen.drawn_cards[id:]
            screen.deck.shuffle_in(card)
            store.delete_cards(statics.BOARD_DB_NAME)
            for card in screen.drawn_cards:
                store.put_card(statics.BOARD_DB_NAME, card.to_json_dict())
    except:
        pass