archiTop/deck_builder/final_deck_builder.py
def construct_final_deck(self):
        """Constructs the final asset json for TableTop.
        Separates mainboard cards from commander, then creates multiple card decks
        for mainboard- and commander-cards.
        """
        mainboard_cards = list(filter(lambda card: not card.commander, self.deck.mainboard))
        commander_cards = list(filter(lambda card: card.commander, self.deck.mainboard))

        # construct related cards card-deck, including tokens
        if token_deck := self._construct_card_deck(self.deck.related_cards, hidden=False):
            self.card_decks.append(token_deck)

        # construct mainboard card-deck
        if mainboard_deck := self._construct_card_deck(mainboard_cards):
            self.card_decks.append(mainboard_deck)

        # construct separate card-deck for commander
        if commander_deck := self._construct_card_deck(commander_cards, hidden=False):
            self.card_decks.append(commander_deck)

        # todo: implement sideboard
        # construct sideboard
        if sideboard_deck := None:
            self.card_decks.append(sideboard_deck)

        # shift deck positions so piles do not combine
        current_x_pos = 0
        for deck in self.card_decks:
            deck['Transform']['posX'] = current_x_pos
            current_x_pos += 2.2

        self.final_deck_json['ObjectStates'] = self.card_decks
Constructs the final asset json for TableTop.
        Separates mainboard cards from commander, then creates multiple card decks
        for mainboard- and commander-cards.
        
Constructs the final asset json for TableTop.
Separates mainboard cards from commander, then creates multiple card decks
for mainboard- and commander-cards.
Constructs the final asset json for TableTop . Separates mainboard cards from commander then creates multiple card decks for mainboard - and commander - cards .
def construct_final_deck(self):
        mainboard_cards = list(filter(lambda card: not card.commander, self.deck.mainboard))
        commander_cards = list(filter(lambda card: card.commander, self.deck.mainboard))
        if token_deck := self._construct_card_deck(self.deck.related_cards, hidden=False):
            self.card_decks.append(token_deck)
        if mainboard_deck := self._construct_card_deck(mainboard_cards):
            self.card_decks.append(mainboard_deck)
        if commander_deck := self._construct_card_deck(commander_cards, hidden=False):
            self.card_decks.append(commander_deck)
        if sideboard_deck := None:
            self.card_decks.append(sideboard_deck)
        current_x_pos = 0
        for deck in self.card_decks:
            deck['Transform']['posX'] = current_x_pos
            current_x_pos += 2.2
        self.final_deck_json['ObjectStates'] = self.card_decks
def construct_final_deck ( self ) : mainboard_cards = list ( filter ( lambda card : not card . commander , self . deck . mainboard ) ) commander_cards = list ( filter ( lambda card : card . commander , self . deck . mainboard ) ) if token_deck := self . _construct_card_deck ( self . deck . related_cards , hidden = False ) : self . card_decks . append ( token_deck ) if mainboard_deck := self . _construct_card_deck ( mainboard_cards ) : self . card_decks . append ( mainboard_deck ) if commander_deck := self . _construct_card_deck ( commander_cards , hidden = False ) : self . card_decks . append ( commander_deck ) if sideboard_deck := None : self . card_decks . append ( sideboard_deck ) current_x_pos = 0 for deck in self . card_decks : deck [ 'Transform' ] [ 'posX' ] = current_x_pos current_x_pos += 2.2 self . final_deck_json [ 'ObjectStates' ] = self . card_decks
Constructs the final asset json for TableTop.
Constructs the final asset json for TableTop .
"""Constructs the final asset json for TableTop.
        Separates mainboard cards from commander, then creates multiple card decks
        for mainboard- and commander-cards.
        """ # construct related cards card-deck, including tokens # construct mainboard card-deck # construct separate card-deck for commander # todo: implement sideboard # construct sideboard # shift deck positions so piles do not combine
self