server/models/cpuPlayer.js
// Returns also keys of the card groups sorted by greatness
Returns also keys of the card groups sorted by greatness
Returns also keys of the card groups sorted by greatness
groupCards(cards, isRevolution) {
    let cardsToGroup = cards.slice().sort(CardHelper.compareCards);
    let cardGroups = _.groupBy(cardsToGroup, card => this.getKeyOfValue(card.value, isRevolution));
    let cardKeys = Object.keys(cardGroups).sort();
    if (isRevolution) {
      cardKeys.reverse();
    }
    return {
      groups: cardGroups,
      keys: cardKeys
    };
  }
groupCards ( cards , isRevolution ) { let cardsToGroup = cards . slice ( ) . sort ( CardHelper . compareCards ) ; let cardGroups = _ . groupBy ( cardsToGroup , card => this . getKeyOfValue ( card . value , isRevolution ) ) ; let cardKeys = Object . keys ( cardGroups ) . sort ( ) ; if ( isRevolution ) { cardKeys . reverse ( ) ; } return { groups : cardGroups , keys : cardKeys } ; }
Returns also keys of the card groups sorted by greatness
Returns also keys of the card groups sorted by greatness