def combinations(self, n): """Generator function return all combinations of n cards (including community cards).""" assertInstance(n, int) cards = Cards(self) if self.board: cards.extend(self.board) return Cards.combinations(cards, n)
def hands(self): """Return all sets of cards that can be constructed from hand.""" cards = Cards(self) if self.board: cards.extend(self.board) yield cards
def extend(self, cards): """Extend while checking to be sure maxCards is not exceeded.""" if self.maxCards: if len(self) + len(cards) > self.maxCards: raise TooManyCardsException() Cards.extend(self, cards)
def getHoleCards(self): """Return the hole (non-community) cards.""" c = Cards() c.extend(self) return c