source/client/ClientState.py
def playCards(self, prepared_cards, processed_full_board={}):
        """Move cards from hand to board if play follows rules, else inform what rule is broken."""

        # First check that all the cards are in your hand.
        tempHand = [x for x in self.hand_cards]
        try:
            for card_group in prepared_cards.values():
                for card in card_group:
                    tempHand.remove(card)
        except ValueError:
            raise Exception("Attempted to play cards that are not in your hand")
        if not self.rules.Shared_Board:
            self.rules.canPlay(prepared_cards, self.played_cards, self.round)
            for key, card_group in prepared_cards.items():
                for card in card_group:
                    self.hand_cards.remove(card)
                    self.played_cards.setdefault(key, []).append(card)
        else:
            self.rules.canPlay(processed_full_board, self.round)
            self.played_cards = processed_full_board
            for key, card_group in prepared_cards.items():
                for card in card_group:
                    self.hand_cards.remove(card)
Move cards from hand to board if play follows rules, else inform what rule is broken.
Move cards from hand to board if play follows rules, else inform what rule is broken.
Move cards from hand to board if play follows rules else inform what rule is broken .
def playCards(self, prepared_cards, processed_full_board={}):
        tempHand = [x for x in self.hand_cards]
        try:
            for card_group in prepared_cards.values():
                for card in card_group:
                    tempHand.remove(card)
        except ValueError:
            raise Exception("Attempted to play cards that are not in your hand")
        if not self.rules.Shared_Board:
            self.rules.canPlay(prepared_cards, self.played_cards, self.round)
            for key, card_group in prepared_cards.items():
                for card in card_group:
                    self.hand_cards.remove(card)
                    self.played_cards.setdefault(key, []).append(card)
        else:
            self.rules.canPlay(processed_full_board, self.round)
            self.played_cards = processed_full_board
            for key, card_group in prepared_cards.items():
                for card in card_group:
                    self.hand_cards.remove(card)
def playCards ( self , prepared_cards , processed_full_board = { } ) : tempHand = [ x for x in self . hand_cards ] try : for card_group in prepared_cards . values ( ) : for card in card_group : tempHand . remove ( card ) except ValueError : raise Exception ( "Attempted to play cards that are not in your hand" ) if not self . rules . Shared_Board : self . rules . canPlay ( prepared_cards , self . played_cards , self . round ) for key , card_group in prepared_cards . items ( ) : for card in card_group : self . hand_cards . remove ( card ) self . played_cards . setdefault ( key , [ ] ) . append ( card ) else : self . rules . canPlay ( processed_full_board , self . round ) self . played_cards = processed_full_board for key , card_group in prepared_cards . items ( ) : for card in card_group : self . hand_cards . remove ( card )
Move cards from hand to board if play follows rules, else inform what rule is broken.
Move cards from hand to board if play follows rules else inform what rule is broken .
"""Move cards from hand to board if play follows rules, else inform what rule is broken.""" # First check that all the cards are in your hand.
self
prepared_cards
processed_full_board