Page 1 of 1

bug for the bga-cards library

Posted: 05 December 2025, 14:15
by thunder0491
I need to report a bug for the bga-cards library.

I will explain it here, but in case I should do it somewhere else, I would appreciate someone could put me in the right direction.

So, this is at the top of my JavaScript file.

Code: Select all

define([
    "dojo","dojo/_base/declare",
    "ebg/core/gamegui",
    "ebg/counter",
    getLibUrl('bga-animations', '1.x'), // the lib 'bga-cards' uses bga-animations so this is required!
    getLibUrl('bga-cards', '1.x'),
],
In the setup function, I create the card manager:

Code: Select all

setup: function(gamedatas) {
    console.log("Starting game setup", gamedatas);

    // create the animation manager, and bind it to the `game.bgaAnimationsActive()` function
    this.animationManager = new BgaAnimations.Manager({animationsActive: () => this.bgaAnimationsActive()});

    // create the card manager
    this.cardsManager = new BgaCards.Manager({
        animationManager: this.animationManager,
        ...
Later, in a foreach, I create stocks(from 1 to ,4 depending on players) of type Deck:

Code: Select all

this.gameCardsStocks[playerId].heaven = new BgaCards.Deck(
        this.cardsManager,
        playerSection.querySelector('.catopomp-player-heaven-cards'),
        { autoRemovePreviousCards: false, cardNumber : 9, counter: { show: true} }
    );
The problem is that only one of the decks is showing the number of cards(9), and the others have 8.
I tried to create the decks empty and later added the cards, and it worked, but when taking cards from the decks, the numbers
were not being shown correctly again.

If I console log the deck object after playing a card, I get this:

Code: Select all

...
cardNumber:7
cards: 
    Array(8)
        0: {id: 102}
        1: {id: 103}
        2: {id: 104}
        3: {id: 105}
        4: {id: 106}
        5: {id: 107}
        6: {id: 108}
        7: {id: 109}
Thanks for your help

Re: bug for the bga-cards library

Posted: 05 December 2025, 16:51
by CagedEye

Re: bug for the bga-cards library

Posted: 05 December 2025, 18:34
by thunder0491
CagedEye wrote: 05 December 2025, 16:51 Bugs can be reported at https://studio.boardgamearena.com/bugs
Thank you. Here is the bug I submitted https://studio.boardgamearena.com/bug?id=243