archiTop/deck_builder/multi_card_deck_builder.py
def _populate_card_template(self, card: ScryfallCard):
        """Creates a new TableTop card object and fills information from card class.
        Each card in deck needs one card object, therefore cards with quantity > 1 will be
        duplicated.
        Same cards, even when duplicated will keep the same ID.

        Once populated, card object is inserted into contained_objects and id added to deck_ids.

        Args:
            card:   Card to create card object for
        """
        card_json = deepcopy(card_template)

        card_json['CardID'] = self.current_card_id
        card_json['Nickname'] = card.tabletop_name

        # create one object per quantity
        for _ in range(card.quantity):
            self.contained_objects.append(card_json)
            self.deck_ids.append(self.current_card_id)

        self.current_card_id += 100
Creates a new TableTop card object and fills information from card class.
        Each card in deck needs one card object, therefore cards with quantity > 1 will be
        duplicated.
        Same cards, even when duplicated will keep the same ID.

        Once populated, card object is inserted into contained_objects and id added to deck_ids.

        Args:
            card:   Card to create card object for
        
Creates a new TableTop card object and fills information from card class.
Each card in deck needs one card object, therefore cards with quantity > 1 will be
duplicated.
Same cards, even when duplicated will keep the same ID.

Once populated, card object is inserted into contained_objects and id added to deck_ids.
Creates a new TableTop card object and fills information from card class . Each card in deck needs one card object therefore cards with quantity > 1 will be duplicated . Same cards even when duplicated will keep the same ID . Once populated card object is inserted into contained_objects and id added to deck_ids .
def _populate_card_template(self, card: ScryfallCard):
        card_json = deepcopy(card_template)
        card_json['CardID'] = self.current_card_id
        card_json['Nickname'] = card.tabletop_name
        for _ in range(card.quantity):
            self.contained_objects.append(card_json)
            self.deck_ids.append(self.current_card_id)
        self.current_card_id += 100
def _populate_card_template ( self , card : ScryfallCard ) : card_json = deepcopy ( card_template ) card_json [ 'CardID' ] = self . current_card_id card_json [ 'Nickname' ] = card . tabletop_name for _ in range ( card . quantity ) : self . contained_objects . append ( card_json ) self . deck_ids . append ( self . current_card_id ) self . current_card_id += 100
Creates a new TableTop card object and fills information from card class.
Creates a new TableTop card object and fills information from card class .
"""Creates a new TableTop card object and fills information from card class.
        Each card in deck needs one card object, therefore cards with quantity > 1 will be
        duplicated.
        Same cards, even when duplicated will keep the same ID.

        Once populated, card object is inserted into contained_objects and id added to deck_ids.

        Args:
            card:   Card to create card object for
        """ # create one object per quantity
self
card
ScryfallCard
Card to create card object for
Card to create card object for