app/models/PlayerAgent.js
//it is then used to generate a random card
it is then used to generate a random card
it is then used to generate a random card
updatePrefixSum(){
    let prefixSum=0;
    let index =0;
    this.card_list = Object.keys(this.card_weights)
    for(const card of this.card_list ){
      prefixSum+=this.card_weights[card]
      this.prefixSum_weights[index]=prefixSum;
      index++;
    }
  }
updatePrefixSum ( ) { let prefixSum = 0 ; let index = 0 ; this . card_list = Object . keys ( this . card_weights ) for ( const card of this . card_list ) { prefixSum += this . card_weights [ card ] this . prefixSum_weights [ index ] = prefixSum ; index ++ ; } }
it is then used to generate a random card
it is then used to generate a random card