bga-cards
    Preparing search index...

    Class CardManager<T>

    Type Parameters

    • T
    Index

    Constructors

    Properties

    animationManager: any

    Methods

    • Parameters

      Returns void

    • Parameters

      • card: T
      • initialSide: "auto" | "front" | "back" = 'auto'

      Returns HTMLDivElement

    • Flips the card.

      Parameters

      • card: T

        the card informations

      • Optionalsettings: FlipCardSettings

        the flip params (to update the card in current stock)

      Returns void

    • Returns string

      the card height set in the settings (undefined if unset)

    • Parameters

      • card: T

        the card informations

      Returns HTMLElement

      the HTML element of an existing card

    • Parameters

      • card: T

        the card informations

      Returns string

      the id for a card element

    • Returns number

      the card height set in the settings (undefined if unset)

    • Return the card rotation. Use getCardRotation from settings if set, else will return 0

      Parameters

      • card: T

        the card informations

      Returns number

      the card rotation

    • Parameters

      • card: T

        the card informations

      Returns HTMLElement[]

      the HTML element of the faces of the card

    • Parameters

      • element: HTMLElement

        the HTML element of the card

      Returns HTMLElement[]

      the HTML element of the faces of the card

    • Returns the stock containing the card.

      Parameters

      • card: T

        the card informations

      Returns CardStock<T>

      the stock containing the card

    • Returns number

      the card with set in the settings (undefined if unset)

    • Returns (deckId: string) => T

    • Parameters

      • card: T

        the card informations

      Returns string | number

      the id for a card

    • Returns SelectionStyle

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

    • Returns SelectionStyle

      the style to apply to selectable cards. Default to class 'bga-cards_selectable-card'.

    • Returns SelectionStyle

      the style to apply to selectable slots. Default to class 'bga-cards_selectable-slot'.

    • Returns SelectionStyle

      the style to apply to selected cards. Default to class 'bga-cards_selected-card'.

    • Returns SelectionStyle

      the style to apply to selected slots. Default to class 'bga-cards_selected-slot'.

    • Returns string

      the type of the cards, either set in the settings or by using a default one if there is only 1 type.

    • Returns SelectionStyle

      the style to apply to unselectable cards. Default to class 'bga-cards_unselectable-card'.

    • Returns SelectionStyle

      the style to apply to unselectable slots. Default to class 'bga-cards_unselectable-slot'.

    • Return if the card passed as parameter is suppose to be visible or not. Use isCardVisible from settings if set, else will check if card.type is defined

      Parameters

      • card: T

        the card informations

      Returns boolean

      the visiblility of the card (true means front side should be displayed)

    • Place a card based on the autoPlace settings of each stock.

      Parameters

      • card: T

      Returns Promise<boolean>

    • Place some cards based on the autoPlace settings of each stock.

      Parameters

      • cards: T[]

      Returns Promise<Promise<boolean>[]>

    • Remove a card.

      Parameters

      Returns Promise<boolean>

    • Parameters

      Returns void

    • Set the card to its front (visible) or back (not visible) side.

      Parameters

      • card: T

        the card informations

      • Optionalvisible: boolean

        if the card is set to visible face. If unset, will use isCardVisible(card)

      • Optionalsettings: FlipCardSettings

        the flip params (to update the card in current stock)

      Returns void

    • Mark the last play card. Remove the other last play card classes.

      Parameters

      • card: T

        the card to mark as last played

      • Optionalcolor: string

        the color to use to mark the last played card, usually the player color

      • OptionalcardClass: string

        a class applied on this type of cards, to limit removal to these type of cards.

      Returns void

    • Mark the last play cards. Remove the other last play card classes.

      Parameters

      • cards: T[]

        the cards to mark as last played

      • Optionalcolor: string

        the color to use to mark the last played card, usually the player color

      • OptionalcardClass: string

        a class applied on this type of cards, to limit removal to these type of cards.

      Returns void

    • Update the card informations. Used when a card with just an id (back shown) should be revealed, with all data needed to populate the front.

      Parameters

      Returns void