bga-cards
    Preparing search index...

    Interface DeckSettings<T>

    interface DeckSettings<T> {
        autoPlace?: (card: T) => boolean;
        autoRemovePreviousCards?: boolean;
        autoUpdateCardNumber?: boolean;
        cardClickEventFilter?: CardClickEventFilter;
        cardNumber?: number;
        counter?: CardCounterSettings;
        fakeCardGenerator?: (deckId: string) => T;
        lastPlayedCardStyle?: SelectionStyle;
        selectableCardStyle?: SelectionStyle;
        selectedCardStyle?: SelectionStyle;
        shadowDirection?: SideOrAngle;
        sort?: SortFunction<T>;
        thicknesses?: number[];
        topCard?: T;
        unselectableCardStyle?: SelectionStyle;
    }

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index

    Properties

    autoPlace?: (card: T) => boolean

    Say if a given card should be placed on this stock, based on card properties. For example, every card with location === 'hand' and location_arg == this.player_id should go to the current player hand. If unset, all cards on this stock must be added manually on this stock.

    Type declaration

      • (card: T): boolean
      • Parameters

        • card: T

          the card to place on a stock

        Returns boolean

        true if the card should be placed on this stock.

    autoRemovePreviousCards?: boolean

    Indicate if the cards under the new top card must be removed (to forbid players to check the content of the deck with Inspect). Default true.

    autoUpdateCardNumber?: boolean

    Indicate if the card count is automatically updated when a card is added or removed.

    cardClickEventFilter?: CardClickEventFilter

    The filter on card click event. Use setting from manager is unset.

    cardNumber?: number

    Indicate the current number of cards in the deck (default 0).

    Show a card counter on the stock. Not visible if unset.

    fakeCardGenerator?: (deckId: string) => T

    A generator of fake cards, to generate decks top card automatically. Default is manager fakeCardGenerator method.

    Type declaration

      • (deckId: string): T
      • Parameters

        • deckId: string

          the deck id

        Returns T

        the fake card to be generated (usually, only informations to show back side)

    lastPlayedCardStyle?: SelectionStyle

    The style to apply to the last played card. Default to class 'bga-cards_last-played-card'.

    selectableCardStyle?: SelectionStyle

    The style to apply to selectable cards. Use style from manager is unset.

    selectedCardStyle?: SelectionStyle

    The style to apply to selected cards. Use style from manager is unset.

    shadowDirection?: SideOrAngle

    Shadow direction. Default 'bottom-right'.

    sort?: SortFunction<T>

    Indicate the card sorting (unset means no sorting, new cards will be added at the end). For example, use sort: sortFunction('type', '-type_arg') to sort by type then type_arg (in reversed order if prefixed with -). Be sure you typed the values correctly! Else '11' will be before '2'.

    thicknesses?: number[]

    Indicate the thresholds to add 1px to the thickness of the pile. Default [0, 2, 5, 10, 20, 30].

    topCard?: T

    Indicate the current top card.

    unselectableCardStyle?: SelectionStyle

    The style to apply to selectable cards. Use style from manager is unset.